1
0

initial import from Debian

version: 14.3.0-5
commit: bee30ab0fff2fd6af94c62376c8aa4221bb831e0
This commit is contained in:
2025-08-11 15:00:09 +03:00
commit c2c1923c7b
274 changed files with 101988 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,242 @@
Description: Ada: select 64 bits time functions from GNU libc when __USE_TIME64_REDIRECTS
This is version 12.
Forwarded: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114065
From: Nicolas Boulenguez <nicolas@debian.org>
--- a/src/gcc/ada/libgnarl/a-exetim__posix.adb
+++ b/src/gcc/ada/libgnarl/a-exetim__posix.adb
@@ -35,6 +35,7 @@ with Ada.Task_Identification; use Ada.T
with Ada.Unchecked_Conversion;
with System.C_Time;
+with System.OS_Constants;
with System.Tasking;
with System.OS_Interface; use System.OS_Interface;
with System.Task_Primitives.Operations; use System.Task_Primitives.Operations;
@@ -115,7 +116,9 @@ package body Ada.Execution_Time is
(clock_id : Interfaces.C.int;
tp : access System.C_Time.timespec)
return int;
- pragma Import (C, clock_gettime, "clock_gettime");
+ pragma Import (C, clock_gettime,
+ (if System.OS_Constants.Glibc_Use_Time_Bits64
+ then "__clock_gettime64" else "clock_gettime"));
-- Function from the POSIX.1b Realtime Extensions library
function pthread_getcpuclockid
--- a/src/gcc/ada/libgnarl/s-osinte__gnu.ads
+++ b/src/gcc/ada/libgnarl/s-osinte__gnu.ads
@@ -39,6 +39,7 @@
-- Preelaborate. This package is designed to be a bottom-level (leaf) package
with Interfaces.C;
+with System.OS_Constants;
with System.C_Time;
with Ada.Unchecked_Conversion;
@@ -208,7 +209,8 @@ package System.OS_Interface is
-- Indicates whether time slicing is supported (i.e SCHED_RR is supported)
function nanosleep (rqtp, rmtp : access C_Time.timespec) return int;
- pragma Import (C, nanosleep, "nanosleep");
+ pragma Import (C, nanosleep, (if OS_Constants.Glibc_Use_Time_Bits64
+ then "__nanosleep64" else "nanosleep"));
type clockid_t is new int;
CLOCK_REALTIME : constant clockid_t := 0;
@@ -218,12 +220,14 @@ package System.OS_Interface is
(clock_id : clockid_t;
tp : access C_Time.timespec)
return int;
- pragma Import (C, clock_gettime, "clock_gettime");
+ pragma Import (C, clock_gettime, (if OS_Constants.Glibc_Use_Time_Bits64
+ then "__clock_gettime64" else "clock_gettime"));
function clock_getres
(clock_id : clockid_t;
res : access C_Time.timespec) return int;
- pragma Import (C, clock_getres, "clock_getres");
+ pragma Import (C, clock_getres, (if OS_Constants.Glibc_Use_Time_Bits64
+ then "__clock_getres64" else "clock_getres"));
-- From: /usr/include/unistd.h
function sysconf (name : int) return long;
@@ -477,7 +481,9 @@ package System.OS_Interface is
(cond : access pthread_cond_t;
mutex : access pthread_mutex_t;
abstime : access C_Time.timespec) return int;
- pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
+ pragma Import (C, pthread_cond_timedwait,
+ (if OS_Constants.Glibc_Use_Time_Bits64 then "__pthread_cond_timedwait64"
+ else "pthread_cond_timedwait"));
Relative_Timed_Wait : constant Boolean := False;
-- pthread_cond_timedwait requires an absolute delay time
--- a/src/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
+++ b/src/gcc/ada/libgnarl/s-osinte__kfreebsd-gnu.ads
@@ -40,6 +40,7 @@
with Ada.Unchecked_Conversion;
with Interfaces.C;
+with System.OS_Constants;
with System.C_Time;
package System.OS_Interface is
@@ -203,7 +204,8 @@ package System.OS_Interface is
-- Indicates whether time slicing is supported (i.e SCHED_RR is supported)
function nanosleep (rqtp, rmtp : access C_Time.timespec) return int;
- pragma Import (C, nanosleep, "nanosleep");
+ pragma Import (C, nanosleep, (if OS_Constants.Glibc_Use_Time_Bits64
+ then "__nanosleep64" else "nanosleep"));
type clockid_t is new int;
CLOCK_REALTIME : constant clockid_t := 0;
@@ -212,12 +214,14 @@ package System.OS_Interface is
(clock_id : clockid_t;
tp : access C_Time.timespec)
return int;
- pragma Import (C, clock_gettime, "clock_gettime");
+ pragma Import (C, clock_gettime, (if OS_Constants.Glibc_Use_Time_Bits64
+ then "__clock_gettime64" else "clock_gettime");
function clock_getres
(clock_id : clockid_t;
res : access C_Time.timespec) return int;
- pragma Import (C, clock_getres, "clock_getres");
+ pragma Import (C, clock_getres, (if OS_Constants.Glibc_Use_Time_Bits64
+ then "__clock_getres64" else "clock_getres");
function sysconf (name : int) return long;
pragma Import (C, sysconf);
@@ -420,7 +424,9 @@ package System.OS_Interface is
(cond : access pthread_cond_t;
mutex : access pthread_mutex_t;
abstime : access C_Time.timespec) return int;
- pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
+ pragma Import (C, pthread_cond_timedwait,
+ (if OS_Constants.Glibc_Use_Time_Bits64 then "__pthread_cond_timedwait64"
+ else "pthread_cond_timedwait");
--------------------------
-- POSIX.1c Section 13 --
--- a/src/gcc/ada/libgnarl/s-osinte__linux.ads
+++ b/src/gcc/ada/libgnarl/s-osinte__linux.ads
@@ -229,12 +229,14 @@ package System.OS_Interface is
function clock_gettime
(clock_id : clockid_t; tp : access C_Time.timespec) return int;
- pragma Import (C, clock_gettime, "clock_gettime");
+ pragma Import (C, clock_gettime, (if OS_Constants.Glibc_Use_Time_Bits64
+ then "__clock_gettime64" else "clock_gettime"));
function clock_getres
(clock_id : clockid_t;
res : access C_Time.timespec) return int;
- pragma Import (C, clock_getres, "clock_getres");
+ pragma Import (C, clock_getres, (if OS_Constants.Glibc_Use_Time_Bits64
+ then "__clock_getres64" else "clock_getres"));
function sysconf (name : int) return long;
pragma Import (C, sysconf);
@@ -445,7 +447,9 @@ package System.OS_Interface is
(cond : access pthread_cond_t;
mutex : access pthread_mutex_t;
abstime : access C_Time.timespec) return int;
- pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
+ pragma Import (C, pthread_cond_timedwait,
+ (if OS_Constants.Glibc_Use_Time_Bits64 then "__pthread_cond_timedwait64"
+ else "pthread_cond_timedwait"));
--------------------------
-- POSIX.1c Section 13 --
--- a/src/gcc/ada/libgnat/g-spogwa.adb
+++ b/src/gcc/ada/libgnat/g-spogwa.adb
@@ -42,7 +42,9 @@ is
writefds : access FD_Set_Type;
exceptfds : access FD_Set_Type;
timeout : access System.C_Time.timeval) return Integer
- with Import => True, Convention => Stdcall, External_Name => "select";
+ with Import => True, Convention => Stdcall,
+ External_Name => (if System.OS_Constants.Glibc_Use_Time_Bits64
+ then "__select64" else "select");
Timeout_V : aliased System.C_Time.timeval;
Timeout_A : access System.C_Time.timeval;
--- a/src/gcc/ada/libgnat/s-osprim__posix.adb
+++ b/src/gcc/ada/libgnat/s-osprim__posix.adb
@@ -31,6 +31,7 @@
-- This version is for POSIX-like operating systems
with System.C_Time;
+with System.OS_Constants;
package body System.OS_Primitives is
@@ -41,7 +42,8 @@ package body System.OS_Primitives is
function nanosleep (rqtp, rmtp : not null access C_Time.timespec)
return Integer;
- pragma Import (C, nanosleep, "nanosleep");
+ pragma Import (C, nanosleep, (if OS_Constants.Glibc_Use_Time_Bits64
+ then "__nanosleep64" else "nanosleep"));
-----------
-- Clock --
@@ -56,7 +58,8 @@ package body System.OS_Primitives is
function gettimeofday
(Tv : access C_Time.timeval;
Tz : System.Address := System.Null_Address) return Integer;
- pragma Import (C, gettimeofday, "gettimeofday");
+ pragma Import (C, gettimeofday, (if OS_Constants.Glibc_Use_Time_Bits64
+ then "__gettimeofday64" else "gettimeofday"));
begin
-- The return codes for gettimeofday are as follows (from man pages):
--- a/src/gcc/ada/libgnat/s-osprim__posix2008.adb
+++ b/src/gcc/ada/libgnat/s-osprim__posix2008.adb
@@ -45,7 +45,8 @@ package body System.OS_Primitives is
function nanosleep (rqtp, rmtp : not null access C_Time.timespec)
return Integer;
- pragma Import (C, nanosleep, "nanosleep");
+ pragma Import (C, nanosleep, (if OS_Constants.Glibc_Use_Time_Bits64
+ then "__nanosleep64" else "nanosleep"));
-----------
-- Clock --
@@ -62,7 +63,8 @@ package body System.OS_Primitives is
function clock_gettime
(clock_id : clockid_t;
tp : access C_Time.timespec) return int;
- pragma Import (C, clock_gettime, "clock_gettime");
+ pragma Import (C, clock_gettime, (if OS_Constants.Glibc_Use_Time_Bits64
+ thon "__clock_gettime64" else "clock_gettime"));
begin
Result := clock_gettime (CLOCK_REALTIME, TS'Unchecked_Access);
--- a/src/gcc/ada/s-oscons-tmplt.c
+++ b/src/gcc/ada/s-oscons-tmplt.c
@@ -1777,6 +1777,22 @@ CND(SIZEOF_tv_nsec, "tv_nsec");
/*
+ -- Functions with time_t suseconds_t timeval timespec parameters like
+ -- clock_get{res,time} gettimeofday nanosleep
+ -- pthread_cond_{,timed}wait select
+ -- must be imported from the GNU C library with
+ -- External_Name => (if Glibc_Use_Time_Bits64 then "__foo64" else "foo")
+ -- The test is safe in files that do not require GNU specifically.
+
+*/
+#if defined(__USE_TIME64_REDIRECTS) || (__TIMESIZE == 32 && __USE_TIME_BITS64)
+ C("Glibc_Use_Time_Bits64", Boolean, "True", "Y2038 Glibc transition")
+#else
+ C("Glibc_Use_Time_Bits64", Boolean, "False", "Y2038 Glibc transition")
+#endif
+
+/*
+
-- Sizes of various data types
*/

56
debian/patches/ada-749574.diff vendored Normal file
View File

@@ -0,0 +1,56 @@
From: Ludovic Brenta <lbrenta@debian.org>
From: Nicolas Boulenguez <nicolas@debian.org>
Forwarded: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81087
Bug-Debian: http://bugs.debian.org/749574
Description: array index out of range in gnatlink
The procedure gnatlink assumes that the Linker_Options.Table contains access
values to strings whose 'First index is always 1. This assumption is wrong
for the string returned by function Base_Name.
.
The wrong indices are not detected because gnatlink is compiled with
-gnatp, but the test result is wrong.
.
PR Ada/81087 shows a reproducer.
--- a/src/gcc/ada/gnatlink.adb
+++ b/src/gcc/ada/gnatlink.adb
@@ -1294,7 +1294,9 @@ procedure Gnatlink is
> Run_Path_Opt'Length
and then
Linker_Options.Table (J)
- (1 .. Run_Path_Opt'Length) =
+ (Linker_Options.Table (J)'First ..
+ Linker_Options.Table (J)'First
+ + Run_Path_Opt'Length - 1) =
Run_Path_Opt
then
-- We have found an already specified
@@ -1892,7 +1894,9 @@ begin
if Linker_Options.Table (J).all = "-Xlinker"
and then J < Linker_Options.Last
and then Linker_Options.Table (J + 1)'Length > 8
- and then Linker_Options.Table (J + 1) (1 .. 8) = "--stack="
+ and then Linker_Options.Table (J + 1)
+ (Linker_Options.Table (J + 1)'First ..
+ Linker_Options.Table (J + 1)'First + 7) = "--stack="
then
if Stack_Op then
Linker_Options.Table (J .. Linker_Options.Last - 2) :=
@@ -1938,11 +1942,15 @@ begin
-- pragma Linker_Options set in the NT runtime.
if (Linker_Options.Table (J)'Length > 17
- and then Linker_Options.Table (J) (1 .. 17) =
+ and then Linker_Options.Table (J)
+ (Linker_Options.Table (J)'First ..
+ Linker_Options.Table (J)'First + 16) =
"-Xlinker --stack=")
or else
(Linker_Options.Table (J)'Length > 12
- and then Linker_Options.Table (J) (1 .. 12) =
+ and then Linker_Options.Table (J)
+ (Linker_Options.Table (J)'First ..
+ Linker_Options.Table (J)'First + 11) =
"-Wl,--stack=")
then
if Stack_Op then

90
debian/patches/ada-armel-libatomic.diff vendored Normal file
View File

@@ -0,0 +1,90 @@
Description: link libgnarl with libatomic on armel and sparc
On other architectures, the library is ignored thanks to --as-needed.
.
Seen with 14-20240429-1 on armel:
cd rts; [bla]/./gcc/xgcc [bla] -shared [bla] -o libgnarl-14.so [bla]
/usr/bin/arm-linux-gnueabi-ld: libgnat-14.so: undefined reference to `__atomic_compare_exchange_8'
/usr/bin/arm-linux-gnueabi-ld: libgnat-14.so: undefined reference to `__atomic_load_8'
.
Seen with 13.2.0-25 on sparc:
checking fp.h usability... /usr/sparc-linux-gnu/bin/ld: libgnat-13.so: undefined reference to `__atomic_compare_exchange_8'
.
Libatomic becomes an artificial dependency for Ada in Makefile.def,
so a better solution is welcome.
.
Autogen should refresh src/Makefile.in from src/Makefile.{def,tpl}
at build time, but we do not want to Build-Depend: guile.
# export QUILT_PATCHES=debian/patches
# quilt pop $this.diff
# quilt add src/Makefile.in
# (cd src && autogen Makefile.def)
# quilt refresh --no-timestamps --no-index -pab
# quilt push -a
.
The issue is hidden without -Wl,--no-allow-shlib-undefined.
(ada-gnattools-cross.diff adds checking options to LDFLAGS,
then adds LDFLAGS to the command line).
Bug-Debian: https://bugs.debian.org/861734
Bug-Debian: https://bugs.debian.org/1072071
Author: Matthias Klose <doko@debian.org>
Author: Nicolas Boulenguez <nicolas@debian.org>
--- a/src/gcc/ada/Makefile.rtl
+++ b/src/gcc/ada/Makefile.rtl
@@ -2302,6 +2302,7 @@ endif
# ARM linux, GNU eabi
ifeq ($(strip $(filter-out arm% linux-gnueabi%,$(target_cpu) $(target_os))),)
+ MISCLIB = ../../../$(target_alias)/libatomic/.libs/libatomic.so
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<libgnarl/a-intnam__linux.ads \
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
@@ -2375,6 +2376,7 @@ endif
# SPARC Linux
ifeq ($(strip $(filter-out sparc% linux%,$(target_cpu) $(target_os))),)
+ MISCLIB = ../../../$(target_alias)/libatomic/.libs/libatomic.so
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<libgnarl/a-intnam__linux.ads \
a-nallfl.ads<libgnat/a-nallfl__wraplf.ads \
--- a/src/Makefile.def
+++ b/src/Makefile.def
@@ -417,6 +417,8 @@ dependencies = { module=all-target-libad
dependencies = { module=all-gnattools; on=all-target-libada; };
dependencies = { module=all-gnattools; on=all-target-libstdc++-v3; };
+dependencies = { module=all-target-libada; on=all-target-libatomic; };
+
// Depending on the specific configuration, the LTO plugin will either use the
// generic libiberty build or the specific build for linker plugins.
dependencies = { module=all-lto-plugin; on=all-libiberty; };
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -68678,6 +68678,9 @@ configure-m4: stage_last
@endif gcc-bootstrap
@if gcc-bootstrap
+@unless target-libatomic-bootstrap
+all-target-libada: maybe-all-target-libatomic
+@endunless target-libatomic-bootstrap
@unless target-zlib-bootstrap
configure-target-fastjar: maybe-configure-target-zlib
@endunless target-zlib-bootstrap
@@ -68713,6 +68716,7 @@ configure-target-libgo: maybe-all-target
@unless gcc-bootstrap
all-target-libada: maybe-all-gcc
all-gnattools: maybe-all-target-libstdc++-v3
+all-target-libada: maybe-all-target-libatomic
configure-libcc1: maybe-configure-gcc
all-libcc1: maybe-all-gcc
all-c++tools: maybe-all-gcc
--- a/src/gcc/ada/gcc-interface/Makefile.in
+++ b/src/gcc/ada/gcc-interface/Makefile.in
@@ -714,6 +714,7 @@ gnatlib-shared-default:
$(GNATRTL_TASKING_OBJS) \
$(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
libgnat$(hyphen)$(LIBRARY_VERSION).so \
+ $(MISCLIB) \
$(THREADSLIB)
cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
libgnat$(soext)

292
debian/patches/ada-gcc-name.diff vendored Normal file
View File

@@ -0,0 +1,292 @@
Description: always call gcc with an explicit target and version
Many problems have been caused by the fact that tools like gnatmake
call other tools like gcc without an explicit target or version.
.
In order to solve this issue for all similar tools at once, AdaCore
has created the Osint.Program_Name function. When gnatmake launches a
gcc subprocess, this function computes the name of the right gcc
executable. This patch improves the function in four ways.
.
The previous algorithm wrongly tests "End_Of_Prefix > 1",
which may happen even if a match has been found.
This part will most probably be of interest for upstream.
.
Update the gnatchop tool to use this function.
This part will most probably be of interest for upstream.
.
Check that the target and version in the gnatmake program name, if
present, match the static constants inside the gnatmake program
itself. Also, knowing the length of the only allowed prefix and suffix
slightly improves performance by avoiding loops.
This part will most probably be of interest for upstream.
.
In Debian, gcc/gcc-version/target-gcc are symbolic links to the
target-gcc-version executable. The same holds for gnatmake, but the
target and version may differ. So "target-gcc-version" is the right
answer. It helps log checkers and humans debuggers, even if gnatmake
was invoked via a shortcut intended for human typers.
This part will probably be hard to merge for upstream, as some
distributions provide no "target-gcc-version".
.
Log for bug 903694 carries regression tests for both bugs.
Forwarded: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87777
Bug-Debian: https://bugs.debian.org/814977
Bug-Debian: https://bugs.debian.org/814978
Bug-Debian: https://bugs.debian.org/856274
Bug-Debian: https://bugs.debian.org/881938
Bug-Debian: https://bugs.debian.org/903694
Author: Ludovic Brenta <lbrenta@debian.org>
Author: Nicolas Boulenguez <nicolas@debian.org>
Author: Svante Signell <svante.signell@gmail.com>
Author: YunQiang Su <wzssyqa@gmail.com>
--- a/src/gcc/ada/osint.ads
+++ b/src/gcc/ada/osint.ads
@@ -144,14 +144,10 @@ package Osint is
-- path) in Name_Buffer, with the length in Name_Len.
function Program_Name (Nam : String; Prog : String) return String_Access;
- -- In the native compilation case, creates a string containing Nam. In the
- -- cross compilation case, looks at the prefix of the current program being
- -- run and prepends it to Nam. For instance if the program being run is
- -- <target>-gnatmake and Nam is "gcc", the returned value will be a pointer
- -- to "<target>-gcc". This function clobbers Name_Buffer and Name_Len.
- -- Also looks at any suffix, e.g. gnatmake-4.1 -> "gcc-4.1". Prog is the
- -- default name of the current program being executed, e.g. "gnatmake",
- -- "gnatlink".
+ -- On Debian, always create a string containing
+ -- Sdefault.Target_Name & '-' & Nam & '-' & Gnatvsn.Library_Version.
+ -- Fail if the program base name differs from Prog,
+ -- maybe extended with the same prefix or suffix.
procedure Write_Program_Name;
-- Writes name of program as invoked to the current output (normally
--- a/src/gcc/ada/osint.adb
+++ b/src/gcc/ada/osint.adb
@@ -2268,50 +2268,51 @@ package body Osint is
------------------
function Program_Name (Nam : String; Prog : String) return String_Access is
- End_Of_Prefix : Natural := 0;
- Start_Of_Prefix : Positive := 1;
- Start_Of_Suffix : Positive;
-
+ -- Most of the work is to check that the current program name
+ -- is consistent with the two static constants below.
+ Suffix : constant String := '-' & Gnatvsn.Library_Version;
+ Prefix : Types.String_Ptr := Sdefault.Target_Name;
+ First : Integer;
+ Result : System.OS_Lib.String_Access;
begin
-- Get the name of the current program being executed
-
Find_Program_Name;
- Start_Of_Suffix := Name_Len + 1;
+ -- If our version is present, skip it.
+ First := Name_Len - Suffix'Length + 1;
+ if 0 < First and then Name_Buffer (First .. Name_Len) = Suffix then
+ Name_Len := First - 1;
+ end if;
+
+ -- The central part must be Prog.
+ First := Name_Len - Prog'Length + 1;
+ if First <= 0 or else Name_Buffer (First .. Name_Len) /= Prog then
+ Fail ("Osint.Program_Name: must end with " & Prog
+ & " or " & Prog & Suffix);
+ end if;
+ Name_Len := First - 1;
- -- Find the target prefix if any, for the cross compilation case.
- -- For instance in "powerpc-elf-gcc" the target prefix is
- -- "powerpc-elf-"
- -- Ditto for suffix, e.g. in "gcc-4.1", the suffix is "-4.1"
-
- for J in reverse 1 .. Name_Len loop
- if Is_Directory_Separator (Name_Buffer (J))
- or else Name_Buffer (J) = ':'
- then
- Start_Of_Prefix := J + 1;
- exit;
- end if;
- end loop;
-
- -- Find End_Of_Prefix
-
- for J in Start_Of_Prefix .. Name_Len - Prog'Length + 1 loop
- if Name_Buffer (J .. J + Prog'Length - 1) = Prog then
- End_Of_Prefix := J - 1;
- exit;
- end if;
- end loop;
+ -- According to Make-generated.in, this ends with a slash.
+ Prefix.all (Prefix.all'Last) := '-';
- if End_Of_Prefix > 1 then
- Start_Of_Suffix := End_Of_Prefix + Prog'Length + 1;
+ -- If our target is present, skip it.
+ First := Name_Len - Prefix.all'Length + 1;
+ if 0 < First and then Name_Buffer (First .. Name_Len) = Prefix.all then
+ Name_Len := First - 1;
end if;
- -- Create the new program name
+ -- What remains must be the directory part.
+ if 0 < Name_Len
+ and then Name_Buffer (Name_Len) /= ':'
+ and then not Is_Directory_Separator (Name_Buffer (Name_Len))
+ then
+ Fail ("Osint.Program_Name: must start with " & Prog
+ & " or " & Prefix.all & Prog);
+ end if;
- return new String'
- (Name_Buffer (Start_Of_Prefix .. End_Of_Prefix)
- & Nam
- & Name_Buffer (Start_Of_Suffix .. Name_Len));
+ Result := new String'(Prefix.all & Nam & Suffix);
+ Types.Free (Prefix);
+ return Result;
end Program_Name;
------------------------------
--- a/src/gcc/ada/gnatchop.adb
+++ b/src/gcc/ada/gnatchop.adb
@@ -36,6 +36,7 @@ with GNAT.OS_Lib; use GNA
with GNAT.Heap_Sort_G;
with GNAT.Table;
+with Osint;
with Switch; use Switch;
with Types;
@@ -44,12 +45,9 @@ procedure Gnatchop is
Config_File_Name : constant String_Access := new String'("gnat.adc");
-- The name of the file holding the GNAT configuration pragmas
- Gcc : String_Access := new String'("gcc");
+ Gcc : String_Access := null;
-- May be modified by switch --GCC=
- Gcc_Set : Boolean := False;
- -- True if a switch --GCC= is used
-
Gnat_Cmd : String_Access;
-- Command to execute the GNAT compiler
@@ -222,12 +220,6 @@ procedure Gnatchop is
Integer'Image
(Maximum_File_Name_Length);
- function Locate_Executable
- (Program_Name : String;
- Look_For_Prefix : Boolean := True) return String_Access;
- -- Locate executable for given program name. This takes into account
- -- the target-prefix of the current command, if Look_For_Prefix is True.
-
subtype EOL_Length is Natural range 0 .. 2;
-- Possible lengths of end of line sequence
@@ -492,76 +484,6 @@ procedure Gnatchop is
Unit.Table (Sorted_Units.Table (U + 1)).File_Name.all;
end Is_Duplicated;
- -----------------------
- -- Locate_Executable --
- -----------------------
-
- function Locate_Executable
- (Program_Name : String;
- Look_For_Prefix : Boolean := True) return String_Access
- is
- Gnatchop_Str : constant String := "gnatchop";
- Current_Command : constant String := Normalize_Pathname (Command_Name);
- End_Of_Prefix : Natural;
- Start_Of_Prefix : Positive;
- Start_Of_Suffix : Positive;
- Result : String_Access;
-
- begin
- Start_Of_Prefix := Current_Command'First;
- Start_Of_Suffix := Current_Command'Last + 1;
- End_Of_Prefix := Start_Of_Prefix - 1;
-
- if Look_For_Prefix then
-
- -- Find Start_Of_Prefix
-
- for J in reverse Current_Command'Range loop
- if Current_Command (J) = '/' or else
- Current_Command (J) = Directory_Separator or else
- Current_Command (J) = ':'
- then
- Start_Of_Prefix := J + 1;
- exit;
- end if;
- end loop;
-
- -- Find End_Of_Prefix
-
- for J in Start_Of_Prefix ..
- Current_Command'Last - Gnatchop_Str'Length + 1
- loop
- if Current_Command (J .. J + Gnatchop_Str'Length - 1) =
- Gnatchop_Str
- then
- End_Of_Prefix := J - 1;
- exit;
- end if;
- end loop;
- end if;
-
- if End_Of_Prefix > Current_Command'First then
- Start_Of_Suffix := End_Of_Prefix + Gnatchop_Str'Length + 1;
- end if;
-
- declare
- Command : constant String :=
- Current_Command (Start_Of_Prefix .. End_Of_Prefix)
- & Program_Name
- & Current_Command (Start_Of_Suffix ..
- Current_Command'Last);
- begin
- Result := Locate_Exec_On_Path (Command);
-
- if Result = null then
- Error_Msg
- (Command & ": installation problem, executable not found");
- end if;
- end;
-
- return Result;
- end Locate_Executable;
-
---------------
-- Parse_EOL --
---------------
@@ -1089,8 +1011,8 @@ procedure Gnatchop is
exit;
when '-' =>
- Gcc := new String'(Parameter);
- Gcc_Set := True;
+ Free (Gcc);
+ Gcc := new String'(Parameter);
when 'c' =>
Compilation_Mode := True;
@@ -1768,9 +1690,13 @@ begin
-- Check presence of required executables
- Gnat_Cmd := Locate_Executable (Gcc.all, not Gcc_Set);
+ if Gcc = null then
+ Gcc := Osint.Program_Name ("gcc", "gnatchop");
+ end if;
+ Gnat_Cmd := Locate_Exec_On_Path (Gcc.all);
if Gnat_Cmd = null then
+ Error_Msg (Gcc.all & ": installation problem, executable not found");
goto No_Files_Written;
end if;

32
debian/patches/ada-gnat-name.diff vendored Normal file
View File

@@ -0,0 +1,32 @@
# DP: use GNATBIND and GNATMAKE passed from the toplevel Makefile
this patch is incomplete. It still fails when building libada.
--- a/src/gcc/ada/Make-generated.in
+++ b/src/gcc/ada/Make-generated.in
@@ -18,7 +18,7 @@ GEN_IL_FLAGS = -gnata -gnat2012 -gnatw.g
ada/seinfo_tables.ads ada/seinfo_tables.adb ada/sinfo.h ada/einfo.h ada/nmake.ads ada/nmake.adb ada/seinfo.ads ada/sinfo-nodes.ads ada/sinfo-nodes.adb ada/einfo-entities.ads ada/einfo-entities.adb: ada/stamp-gen_il ; @true
ada/stamp-gen_il: $(fsrcdir)/ada/gen_il*
$(MKDIR) ada/gen_il
- cd ada/gen_il; gnatmake -q -g $(GEN_IL_FLAGS) gen_il-main
+ cd ada/gen_il; $(GNATMAKE) -q -g $(GEN_IL_FLAGS) gen_il-main
# Ignore errors to work around finalization issues in older compilers
- cd ada/gen_il; ./gen_il-main
$(fsrcdir)/../move-if-change ada/gen_il/seinfo_tables.ads ada/seinfo_tables.ads
@@ -39,14 +39,14 @@ ada/stamp-gen_il: $(fsrcdir)/ada/gen_il*
# would cause bootstrapping with older compilers to fail. You can call it by
# hand, as a sanity check that these files are legal.
ada/seinfo_tables.o: ada/seinfo_tables.ads ada/seinfo_tables.adb
- cd ada ; gnatmake $(GEN_IL_INCLUDES) seinfo_tables.adb -gnatU -gnatX
+ cd ada ; $(GNATMAKE) $(GEN_IL_INCLUDES) seinfo_tables.adb -gnatU -gnatX
ada/snames.h ada/snames.ads ada/snames.adb : ada/stamp-snames ; @true
ada/stamp-snames : ada/snames.ads-tmpl ada/snames.adb-tmpl ada/snames.h-tmpl ada/xsnamest.adb ada/xutil.ads ada/xutil.adb
-$(MKDIR) ada/bldtools/snamest
$(RM) $(addprefix ada/bldtools/snamest/,$(notdir $^))
$(CP) $^ ada/bldtools/snamest
- cd ada/bldtools/snamest && gnatmake -q xsnamest && ./xsnamest
+ cd ada/bldtools/snamest && $(GNATMAKE) -q xsnamest && ./xsnamest
$(fsrcdir)/../move-if-change ada/bldtools/snamest/snames.ns ada/snames.ads
$(fsrcdir)/../move-if-change ada/bldtools/snamest/snames.nb ada/snames.adb
$(fsrcdir)/../move-if-change ada/bldtools/snamest/snames.nh ada/snames.h

228
debian/patches/ada-gnattools-cross.diff vendored Normal file
View File

@@ -0,0 +1,228 @@
TODO: Check that the part removing the dependency from stamp-gnatlib1
to stamp-gnatlib2 is not necessary anymore with gcc-9.
* Link tools dynamically.
* Prevent direct embedding of libada objects:
Mark ALI files as read-only, remove objects after the build.
A solution keeping the objects would be more intrusive.
* Rebuild gnatbind/make/link with themselves.
This removes unneeded objects inherited from the hardcoded bootstrap list.
The same thing would be useful for gnat1drv, but is less easy.
* TOOLS_ALREADY_COMPILED lists LIBGNAT objects that
gcc/ada/gcc-interface/Makefile should not rebuild.
* Link libgnat/gnarl with LDFLAGS.
* Link libgnarl with an explicit path to a shared object.
This prevents undefined symbols or unwanted usage of host libgnat.
* Compile with -gnatn for efficiency.
Double-check the link since Debian moves some symbols.
* set LD_LIBRARY_PATH so that rebuilt tools can be executed.
--- a/src/gcc/ada/Makefile.rtl
+++ b/src/gcc/ada/Makefile.rtl
@@ -1846,6 +1846,11 @@ ifeq ($(strip $(filter-out s390% linux%,
LIBRARY_VERSION := $(LIB_VERSION)
endif
+ifeq ($(strip $(filter-out hppa% unknown linux gnu,$(targ))),)
+ GNATLIB_SHARED = gnatlib-shared-dual
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
# HP/PA HP-UX 10
ifeq ($(strip $(filter-out hppa% hp hpux10%,$(target_cpu) $(target_vendor) $(target_os))),)
LIBGNAT_TARGET_PAIRS = \
--- a/src/gcc/ada/gcc-interface/Makefile.in
+++ b/src/gcc/ada/gcc-interface/Makefile.in
@@ -503,6 +503,20 @@ gnatlink-re: ../stamp-tools gnatmake-re
--GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
$(MV) ../../gnatlinknew$(exeext) ../../gnatlink$(exeext)
+gnatbind-re: ../stamp-tools gnatmake-re gnatlink-re
+ $(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatbind --GCC="$(CC) $(ALL_ADAFLAGS)"
+ $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatbind
+ $(GNATLINK) -v gnatbind -o ../../gnatbind$(exeext) \
+ --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
+
+# When driven by gnattools/Makefile for a native build,
+# TOOLS_ALREADY_COMPILED will list objects in the target standard Ada
+# libraries, that Make should avoid rebuilding.
+# We cannot use recursive variables to avoid an infinite loop,
+# so we must put this after definition of EXTRA_GNATMAKE_OBJS.
+GNATLINK_OBJS := $(filter-out $(TOOLS_ALREADY_COMPILED),$(GNATLINK_OBJS))
+GNATMAKE_OBJS := $(filter-out $(TOOLS_ALREADY_COMPILED),$(GNATMAKE_OBJS))
+
# Needs to be built with CC=gcc
# Since the RTL should be built with the latest compiler, remove the
# stamp target in the parent directory whenever gnat1 is rebuilt
@@ -630,7 +644,7 @@ $(RTSDIR)/s-oscons.ads: ../stamp-gnatlib
$(OSCONS_EXTRACT) ; \
../bldtools/oscons/xoscons s-oscons)
-gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR) $(RTSDIR)/s-oscons.ads
+gnatlib: ../stamp-gnatlib1-$(RTSDIR) $(RTSDIR)/s-oscons.ads
test -f $(RTSDIR)/s-oscons.ads || exit 1
# C files
$(MAKE) -C $(RTSDIR) \
@@ -662,18 +676,30 @@ gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../
$(RANLIB_FOR_TARGET) $(RTSDIR)/libgmem$(arext)
endif
$(CHMOD) a-wx $(RTSDIR)/*.ali
+# Provide .ads .adb (read-only).ali .so .a, but prevent direct use of .o.
+ $(RM) $(RTSDIR)/*.o
touch ../stamp-gnatlib-$(RTSDIR)
# Warning: this target assumes that LIBRARY_VERSION has been set correctly.
gnatlib-shared-default:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET) -fno-lto" \
- GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) $(PICFLAG_FOR_TARGET) -fno-lto" \
- MULTISUBDIR="$(MULTISUBDIR)" \
- THREAD_KIND="$(THREAD_KIND)" \
- LN_S="$(LN_S)" \
- gnatlib
+ $(MAKE) -C $(RTSDIR) \
+ CC="`echo \"$(GCC_FOR_TARGET)\" \
+ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
+ INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
+ CFLAGS="$(GNATLIBCFLAGS_FOR_C) $(PICFLAG_FOR_TARGET) -fno-lto" \
+ FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
+ srcdir=$(fsrcdir) \
+ -f ../Makefile $(LIBGNAT_OBJS)
+ $(MAKE) -C $(RTSDIR) \
+ CC="`echo \"$(GCC_FOR_TARGET)\" \
+ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
+ ADA_INCLUDES="" \
+ CFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET) -fno-lto" \
+ ADAFLAGS="$(GNATLIBFLAGS) $(PICFLAG_FOR_TARGET) -fno-lto" \
+ FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
+ srcdir=$(fsrcdir) \
+ -f ../Makefile \
+ $(GNATRTL_OBJS)
$(RM) $(RTSDIR)/libgna*$(soext)
cd $(RTSDIR); $(GCC_FOR_ADA_RTS) -shared $(GNATLIBCFLAGS) \
$(PICFLAG_FOR_TARGET) \
@@ -684,8 +710,10 @@ gnatlib-shared-default:
cd $(RTSDIR); $(GCC_FOR_ADA_RTS) -shared $(GNATLIBCFLAGS) \
$(PICFLAG_FOR_TARGET) \
-o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(LDFLAGS) \
$(GNATRTL_TASKING_OBJS) \
$(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ libgnat$(hyphen)$(LIBRARY_VERSION).so \
$(THREADSLIB)
cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
libgnat$(soext)
@@ -701,6 +729,10 @@ gnatlib-shared-default:
$(addprefix $(RTSDIR)/,$(GNATRTL_TASKING_OBJS))
$(RANLIB_FOR_TARGET) $(RTSDIR)/libgnarl_pic$(arext)
+# Provide .ads .adb (read-only).ali .so .a, but prevent direct use of .o.
+ $(CHMOD) a-wx $(RTSDIR)/*.ali
+ $(RM) $(RTSDIR)/*.o
+
gnatlib-shared-dual:
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
@@ -710,11 +742,8 @@ gnatlib-shared-dual:
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
LN_S="$(LN_S)" \
- gnatlib-shared-default
- $(MV) $(RTSDIR)/libgna*$(soext) .
- $(MV) $(RTSDIR)/libgnat_pic$(arext) .
- $(MV) $(RTSDIR)/libgnarl_pic$(arext) .
- $(RM) ../stamp-gnatlib2-$(RTSDIR)
+ gnatlib
+ $(RM) $(RTSDIR)/*.o $(RTSDIR)/*.ali
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
@@ -722,10 +751,7 @@ gnatlib-shared-dual:
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
LN_S="$(LN_S)" \
- gnatlib
- $(MV) libgna*$(soext) $(RTSDIR)
- $(MV) libgnat_pic$(arext) $(RTSDIR)
- $(MV) libgnarl_pic$(arext) $(RTSDIR)
+ gnatlib-shared-default
gnatlib-shared-dual-win32:
$(MAKE) $(FLAGS_TO_PASS) \
@@ -736,9 +762,8 @@ gnatlib-shared-dual-win32:
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
LN_S="$(LN_S)" \
- gnatlib-shared-win32
- $(MV) $(RTSDIR)/libgna*$(soext) .
- $(RM) ../stamp-gnatlib2-$(RTSDIR)
+ gnatlib
+ $(RM) $(RTSDIR)/*.o $(RTSDIR)/*.ali
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
@@ -746,8 +771,7 @@ gnatlib-shared-dual-win32:
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
LN_S="$(LN_S)" \
- gnatlib
- $(MV) libgna*$(soext) $(RTSDIR)
+ gnatlib-shared-win32
# ??? we need to add the option to support auto-import of arrays/records to
# the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
--- a/src/gnattools/Makefile.in
+++ b/src/gnattools/Makefile.in
@@ -75,16 +75,23 @@ CXX_LFLAGS = \
-L../../../$(target_noncanonical)/libstdc++-v3/src/.libs \
-L../../../$(target_noncanonical)/libstdc++-v3/libsupc++/.libs
+rtsdir := $(abspath ../gcc/ada/rts)
+
# Variables for gnattools, native
TOOLS_FLAGS_TO_PASS_NATIVE= \
"CC=../../xgcc -B../../" \
"CXX=../../xg++ -B../../ $(CXX_LFLAGS)" \
"CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
- "LDFLAGS=$(LDFLAGS)" \
- "ADAFLAGS=$(ADAFLAGS)" \
+ "LDFLAGS=$(LDFLAGS) -Wl,--no-allow-shlib-undefined \
+ -Wl,--no-copy-dt-needed-entries -Wl,--no-undefined" \
+ "ADAFLAGS=$(ADAFLAGS) -gnatn" \
"ADA_CFLAGS=$(ADA_CFLAGS)" \
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
- "ADA_INCLUDES=-I- -I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
+ "ADA_INCLUDES=-I- -nostdinc -I$(rtsdir) $(ADA_INCLUDES_FOR_SUBDIR)" \
+ "TOOLS_ALREADY_COMPILED=$(foreach d, $(rtsdir), \
+ $(patsubst $(d)/%.ali,%.o, $(wildcard $(d)/*.ali)))" \
+ 'LIBGNAT=$(rtsdir)/libgnat-$$(LIB_VERSION).so' \
+ "GNATBIND_FLAGS=-nostdlib -x" \
"exeext=$(exeext)" \
"fsrcdir=$(fsrcdir)" \
"srcdir=$(fsrcdir)" \
@@ -194,6 +201,10 @@ $(GCC_DIR)/stamp-tools:
# to be able to build gnatmake without a version of gnatmake around. Once
# everything has been compiled once, gnatmake can be recompiled with itself
# (see target regnattools)
+gnattools-native: export LD_LIBRARY_PATH := \
+ $(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)$(rtsdir)
+# Useful even for 1st pass, as ../../gnatmake may already be
+# dynamically linked in case this target has already been invoked.
gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib-rts
# gnattools1
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
@@ -202,6 +213,13 @@ gnattools-native: $(GCC_DIR)/stamp-tools
# gnattools2
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
$(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools
+# The hard-coded object lists for gnatbind/make/link contain unneeded
+# objects. Use the fresh tools to recompute dependencies.
+# A separate Make run avoids race conditions between gnatmakes
+# building the same object for common-tools and gnat*-re.
+# (parallelism is already forbidden between gnat*-re targets)
+ $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
+ $(TOOLS_FLAGS_TO_PASS_NATIVE) gnatbind-re gnatmake-re gnatlink-re
# gnatmake/link can be built with recent gnatmake/link if they are available.
# This is especially convenient for building cross tools or for rebuilding

37
debian/patches/ada-hurd-amd64.diff vendored Normal file
View File

@@ -0,0 +1,37 @@
--- a/src/gcc/ada/Makefile.rtl
+++ b/src/gcc/ada/Makefile.rtl
@@ -1683,6 +1683,34 @@ ifeq ($(strip $(filter-out x86_64 kfreeb
LIBRARY_VERSION := $(LIB_VERSION)
endif
+# x86_64-pc-gnu i.e. GNU Hurd
+ifeq ($(strip $(filter-out x86_64 pc gnu,$(target_cpu) $(target_os))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<libgnarl/a-intnam__freebsd.ads \
+ s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
+ s-intman.adb<libgnarl/s-intman__posix.adb \
+ s-osinte.adb<libgnarl/s-osinte__gnu.adb \
+ s-osinte.ads<libgnarl/s-osinte__gnu.ads \
+ s-osprim.adb<libgnat/s-osprim__posix.adb \
+ s-taprop.adb<libgnarl/s-taprop__posix.adb \
+ s-taspri.ads<libgnarl/s-taspri__posix.ads \
+ s-tpopsp.adb<libgnarl/s-tpopsp__posix-foreign.adb \
+ $(ATOMICS_TARGET_PAIRS) \
+ $(X86_64_TARGET_PAIRS) \
+ $(GNATRTL_128BIT_PAIRS) \
+ system.ads<libgnat/system-freebsd.ads
+
+ EXTRA_GNATRTL_NONTASKING_OBJS = $(GNATRTL_128BIT_OBJS)
+
+ TOOLS_TARGET_PAIRS = indepsw.adb<indepsw-gnu.adb
+
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
# aarch64 FreeBSD
ifeq ($(strip $(filter-out %aarch64 freebsd%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS = \

View File

@@ -0,0 +1,121 @@
Description: set ALI timestamps from SOURCE_DATE_EPOCH if available.
When the SOURCE_DATE_EPOCH environment variable is set,
replace timestamps more recent than its value with its value
when writing Ada Library Information (ALI) files.
This allow reproducible builds from generated or patched Ada sources.
https://reproducible-builds.org/specs/source-date-epoch/
.
Also see debian/ada/test_ada_source_date_epoch.sh.
Author: Nicolas Boulenguez <nicolas@debian.org>
--- a/src/gcc/ada/osint.adb
+++ b/src/gcc/ada/osint.adb
@@ -64,6 +64,10 @@ package body Osint is
-- Used in Locate_File as a fake directory when Name is already an
-- absolute path.
+ Source_Date_Epoch : OS_Time := Invalid_Time;
+ -- Set at startup by the Initialize procedure.
+ -- See the specification of the File_Time_Stamp functions.
+
-------------------------------------
-- Use of Name_Find and Name_Enter --
-------------------------------------
@@ -1126,8 +1130,14 @@ package body Osint is
is
function Internal (N : C_File_Name; A : System.Address) return OS_Time;
pragma Import (C, Internal, "__gnat_file_time_name_attr");
+ T : OS_Time := Internal (Name, Attr.all'Address);
begin
- return Internal (Name, Attr.all'Address);
+ if Source_Date_Epoch /= Invalid_Time and then T /= Invalid_Time
+ and then Source_Date_Epoch < T
+ then
+ T := Source_Date_Epoch;
+ end if;
+ return T;
end File_Time_Stamp;
function File_Time_Stamp
@@ -1150,6 +1160,7 @@ package body Osint is
----------------
function File_Stamp (Name : File_Name_Type) return Time_Stamp_Type is
+ T : OS_Time;
begin
if Name = No_File then
return Empty_Time_Stamp;
@@ -1161,9 +1172,13 @@ package body Osint is
-- not exist, and OS_Time_To_GNAT_Time will convert this value to
-- Empty_Time_Stamp. Therefore we do not need to first test whether
-- the file actually exists, which saves a system call.
-
- return OS_Time_To_GNAT_Time
- (File_Time_Stamp (Name_Buffer (1 .. Name_Len)));
+ T := File_Time_Stamp (Name_Buffer (1 .. Name_Len));
+ if Source_Date_Epoch /= Invalid_Time and then T /= Invalid_Time
+ and then Source_Date_Epoch < T
+ then
+ T := Source_Date_Epoch;
+ end if;
+ return OS_Time_To_GNAT_Time (T);
end File_Stamp;
function File_Stamp (Name : Path_Name_Type) return Time_Stamp_Type is
@@ -3261,4 +3276,34 @@ begin
Osint.Initialize;
end Initialization;
+ -- When the SOURCE_DATE_EPOCH the environment variable is not empty,
+ -- only contains decimal digits and represents a value lower than 2**63,
+ -- set Source_Date_Epoch to this value.
+ Set_Source_Date_Epoch : declare
+ Env_Var : String_Access := Getenv ("SOURCE_DATE_EPOCH");
+ Epoch : Long_Long_Integer range 0 .. Long_Long_Integer'Last := 0;
+ Index : Integer range Env_Var.all'First .. Env_Var.all'Last + 1
+ := Env_Var.all'First;
+ Digit : Long_Long_Integer;
+ begin
+ if Index <= Env_Var.all'Last then
+ -- Calling System.Val_LLI breaks the bootstrap sequence.
+ loop
+ Digit := Character'Pos (Env_Var.all (Index)) - Character'Pos ('0');
+ exit when Digit not in 0 .. 9;
+ exit when Long_Long_Integer'Last - Digit < Epoch;
+ Epoch := Epoch + Digit;
+ if Index = Env_Var.all'Last then
+ Source_Date_Epoch := To_Ada (Epoch);
+ exit;
+ end if;
+ Index := Index + 1;
+ -- The division is computed once at build time.
+ exit when Long_Long_Integer'Last / 10 < Epoch;
+ Epoch := Epoch * 10;
+ end loop;
+ end if;
+ Free (Env_Var);
+ end Set_Source_Date_Epoch;
+
end Osint;
--- a/src/gcc/ada/osint.ads
+++ b/src/gcc/ada/osint.ads
@@ -196,6 +196,7 @@ package Osint is
-- information in order to locate it. If the source file cannot be opened,
-- or Name = No_File, and all blank time stamp is returned (this is not an
-- error situation).
+ -- Handles SOURCE_DATE_EPOCH like File_Time_Stamp functions below.
function File_Stamp (Name : Path_Name_Type) return Time_Stamp_Type;
-- Same as above for a path name
@@ -303,6 +304,11 @@ package Osint is
(Name : Path_Name_Type;
Attr : access File_Attributes) return Time_Stamp_Type;
-- Return the time stamp of the file
+ -- If the SOURCE_DATE_EPOCH environment variable exists and represents
+ -- an OS_Type value, any more recent file time stamp is truncated.
+ -- This ensures that gnat1 writes deterministic .ali files even in
+ -- the presence of patched or generated sources. See
+ -- https://reproducible-builds.org/specs/source-date-epoch.
function Is_Readable_File
(Name : C_File_Name;

168
debian/patches/ada-link-lib.diff vendored Normal file
View File

@@ -0,0 +1,168 @@
Description: adapt libgnat build for Debian
Don't include a runtime link path (-rpath), when linking binaries.
.
Build the shared libraries on hppa-linux (see #786692 below).
TODO: ask the reporter (no porterbox) to attempt a rebuild without this
chunk, now that we diverge less from upstream.
.
Instead of building libada as a target library only, build it as
both a host and, if different, target library.
.
Compile with -gnatn for efficiency.
Double-check the link since Debian moves some symbols.
.
Autogen should refresh src/Makefile.in from src/Makefile.{def,tpl}
at build time, but we do not want to Build-Depend: guile.
# export QUILT_PATCHES=debian/patches
# quilt pop $this.diff
# quilt add src/Makefile.in
# (cd src && autogen Makefile.def)
# quilt refresh --no-timestamps --no-index -pab
# quilt push -a
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786692
Forwarded: not-needed
Author: Ludovic Brenta <lbrenta@debian.org>
Author: Nicolas Boulenguez <nicolas@debian.org>
Author: Matthias Klose <doko@debian.org>
--- a/src/gcc/ada/gcc-interface/config-lang.in
+++ b/src/gcc/ada/gcc-interface/config-lang.in
@@ -44,7 +44,7 @@ if test "x$cross_compiling/$build/$host"
fi
target_libs="target-libada"
-lang_dirs="gnattools"
+lang_dirs="libada gnattools"
# Ada is not enabled by default for the time being.
build_by_default=no
--- a/src/gcc/ada/link.c
+++ b/src/gcc/ada/link.c
@@ -107,9 +107,9 @@ const char *__gnat_default_libgcc_subdir
|| defined (__NetBSD__) || defined (__OpenBSD__) \
|| defined (__QNX__)
const char *__gnat_object_file_option = "-Wl,@";
-const char *__gnat_run_path_option = "-Wl,-rpath,";
-char __gnat_shared_libgnat_default = STATIC;
-char __gnat_shared_libgcc_default = STATIC;
+const char *__gnat_run_path_option = "";
+char __gnat_shared_libgnat_default = SHARED;
+char __gnat_shared_libgcc_default = SHARED;
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
@@ -129,9 +129,9 @@ const char *__gnat_default_libgcc_subdir
#elif defined (__linux__) || defined (__GLIBC__)
const char *__gnat_object_file_option = "-Wl,@";
-const char *__gnat_run_path_option = "-Wl,-rpath,";
-char __gnat_shared_libgnat_default = STATIC;
-char __gnat_shared_libgcc_default = STATIC;
+const char *__gnat_run_path_option = "";
+char __gnat_shared_libgnat_default = SHARED;
+char __gnat_shared_libgcc_default = SHARED;
int __gnat_link_max = 8192;
unsigned char __gnat_objlist_file_supported = 1;
const char *__gnat_object_library_extension = ".a";
--- a/src/libada/Makefile.in
+++ b/src/libada/Makefile.in
@@ -79,10 +79,11 @@ ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,
# by recursive make invocations in gcc/ada/Makefile.in
LIBADA_FLAGS_TO_PASS = \
"MAKEOVERRIDES=" \
- "LDFLAGS=$(LDFLAGS)" \
+ "LDFLAGS=$(LDFLAGS) -Wl,--no-allow-shlib-undefined \
+ -Wl,--no-copy-dt-needed-entries -Wl,--no-undefined" \
"LN_S=$(LN_S)" \
"SHELL=$(SHELL)" \
- "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \
+ "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS) -gnatn" \
"GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \
"GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \
"PICFLAG_FOR_TARGET=$(PICFLAG)" \
--- a/src/Makefile.def
+++ b/src/Makefile.def
@@ -413,6 +413,7 @@ dependencies = { module=all-libcpp; on=a
dependencies = { module=all-fixincludes; on=all-libiberty; };
+dependencies = { module=all-target-libada; on=all-gcc; };
dependencies = { module=all-gnattools; on=all-target-libada; };
dependencies = { module=all-gnattools; on=all-target-libstdc++-v3; };
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -68711,6 +68711,7 @@ configure-target-libgo: maybe-all-target
@endif gcc-bootstrap
@unless gcc-bootstrap
+all-target-libada: maybe-all-gcc
all-gnattools: maybe-all-target-libstdc++-v3
configure-libcc1: maybe-configure-gcc
all-libcc1: maybe-all-gcc
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -143,6 +143,11 @@ host_libs="gettext libiberty opcodes bfd
# If --enable-gold is used, "gold" may replace "ld".
host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gm2tools gotools c++tools"
+case "${target}" in
+ hppa64-*linux*) ;;
+ *) target_libiberty="target-libiberty";;
+esac
+
# these libraries are built for the target environment, and are built after
# the host libraries and the host tools (which may be a cross compiler)
# Note that libiberty is not a target library.
@@ -162,6 +167,7 @@ target_libraries="target-libgcc \
target-libffi \
target-libobjc \
target-libada \
+ ${target_libiberty} \
target-libgm2 \
target-libgo \
target-libgrust \
--- a/src/gcc/ada/gcc-interface/Make-lang.in
+++ b/src/gcc/ada/gcc-interface/Make-lang.in
@@ -43,7 +43,7 @@ RMDIR = rm -rf
# Extra flags to pass to recursive makes.
-COMMON_ADAFLAGS= -gnatpg
+COMMON_ADAFLAGS= -gnatpgn
ifeq ($(TREECHECKING),)
CHECKING_ADAFLAGS=
else
@@ -267,7 +267,9 @@ GCC_LINKERFLAGS = $(filter-out -Werror -
GCC_LDFLAGS = $(filter-out -static-libgcc, $(LDFLAGS))
else
# Strip -Werror during linking for the LTO bootstrap
-GCC_LINKERFLAGS = $(filter-out -Werror, $(ALL_LINKERFLAGS))
+GCC_LINKERFLAGS = $(filter-out -Werror, $(ALL_LINKERFLAGS)) \
+ -Wl,--no-allow-shlib-undefined -Wl,--no-copy-dt-needed-entries \
+ -Wl,--no-undefined
GCC_LDFLAGS = $(LDFLAGS)
endif
--- a/src/gcc/testsuite/lib/gnat.exp
+++ b/src/gcc/testsuite/lib/gnat.exp
@@ -115,6 +115,7 @@ proc gnat_target_compile { source dest t
global TOOL_OPTIONS
global gnat_target_current
global TEST_ALWAYS_FLAGS
+ global ld_library_path
# dg-require-effective-target tests must be compiled as C.
if [ string match "*.c" $source ] then {
@@ -144,6 +145,11 @@ proc gnat_target_compile { source dest t
# Always log so compilations can be repeated manually.
verbose -log "ADA_INCLUDE_PATH=$rtsdir/adainclude"
verbose -log "ADA_OBJECTS_PATH=$rtsdir/adainclude"
+
+ if { ! [ string match "*/libada/adalib*" $ld_library_path ] } {
+ append ld_library_path ":$rtsdir/adalib"
+ set_ld_library_path_env_vars
+ }
}
lappend options "compiler=$GNAT_UNDER_TEST -q -f"

View File

@@ -0,0 +1,290 @@
Revert upstream commit a210011c5c7f7be5e7a9aea294947bdc555202ce
(Ada: Fix thinko in Eigensystem for complex Hermitian matrices)
This fix would change the libgnat-14-HASH virtual package and require
a rebuild of all Ada libraries.
Bug-Debian: http://bugs.debian.org/1104593
--- a/src/gcc/ada/libgnat/a-ngcoar.adb
+++ b/src/gcc/ada/libgnat/a-ngcoar.adb
@@ -1058,21 +1058,19 @@ package body Ada.Numerics.Generic_Comple
is
N : constant Natural := Length (A);
- -- For a Hermitian matrix A, we convert the eigenvalue problem to a
- -- real symmetric one: if A = X + i * Y, then the (N, N) complex
+ -- For a Hermitian matrix C, we convert the eigenvalue problem to a
+ -- real symmetric one: if C = A + i * B, then the (N, N) complex
-- eigenvalue problem:
- --
- -- (X + i * Y) * (u + i * v) = Lambda * (u + i * v)
+ -- (A + i * B) * (u + i * v) = Lambda * (u + i * v)
--
-- is equivalent to the (2 * N, 2 * N) real eigenvalue problem:
+ -- [ A, B ] [ u ] = Lambda * [ u ]
+ -- [ -B, A ] [ v ] [ v ]
--
- -- [ X, -Y ] [ u ] = Lambda * [ u ]
- -- [ Y, X ] [ v ] [ v ]
- --
- -- Note that the (2 * N, 2 * N) matrix M above is symmetric, because
- -- Transpose (X) = X and Transpose (Y) = -Y as A is Hermitian.
+ -- Note that the (2 * N, 2 * N) matrix above is symmetric, as
+ -- Transpose (A) = A and Transpose (B) = -B if C is Hermitian.
- -- We solve this eigensystem using the real-valued algorithm. The final
+ -- We solve this eigensystem using the real-valued algorithms. The final
-- result will have every eigenvalue twice, so in the sorted output we
-- just pick every second value, with associated eigenvector u + i * v.
@@ -1087,8 +1085,10 @@ package body Ada.Numerics.Generic_Comple
C : constant Complex :=
(A (A'First (1) + (J - 1), A'First (2) + (K - 1)));
begin
- M (J, K) := Re (C); M (J, K + N) := -Im (C);
- M (J + N, K) := Im (C); M (J + N, K + N) := Re (C);
+ M (J, K) := Re (C);
+ M (J + N, K + N) := Re (C);
+ M (J + N, K) := Im (C);
+ M (J, K + N) := -Im (C);
end;
end loop;
end loop;
@@ -1103,9 +1103,10 @@ package body Ada.Numerics.Generic_Comple
for K in 1 .. N loop
declare
- Row : constant Integer := Vectors'First (1) + (K - 1);
+ Row : constant Integer := Vectors'First (2) + (K - 1);
begin
- Vectors (Row, Col) := (Vecs (K, 2 * J), Vecs (K + N, 2 * J));
+ Vectors (Row, Col)
+ := (Vecs (J * 2, Col), Vecs (J * 2, Col + N));
end;
end loop;
end;
@@ -1117,14 +1118,13 @@ package body Ada.Numerics.Generic_Comple
-----------------
function Eigenvalues (A : Complex_Matrix) return Real_Vector is
- N : constant Natural := Length (A);
-
-- See Eigensystem for a description of the algorithm
+ N : constant Natural := Length (A);
+ R : Real_Vector (A'Range (1));
+
M : Real_Matrix (1 .. 2 * N, 1 .. 2 * N);
- R : Real_Vector (A'Range (1));
Vals : Real_Vector (1 .. 2 * N);
-
begin
for J in 1 .. N loop
for K in 1 .. N loop
@@ -1132,8 +1132,10 @@ package body Ada.Numerics.Generic_Comple
C : constant Complex :=
(A (A'First (1) + (J - 1), A'First (2) + (K - 1)));
begin
- M (J, K) := Re (C); M (J, K + N) := -Im (C);
- M (J + N, K) := Im (C); M (J + N, K + N) := Re (C);
+ M (J, K) := Re (C);
+ M (J + N, K + N) := Re (C);
+ M (J + N, K) := Im (C);
+ M (J, K + N) := -Im (C);
end;
end loop;
end loop;
--- a/src/gcc/ada/libgnat/a-ngrear.adb
+++ b/src/gcc/ada/libgnat/a-ngrear.adb
@@ -85,7 +85,7 @@ package body Ada.Numerics.Generic_Real_A
function Is_Symmetric (A : Real_Matrix) return Boolean is
(Transpose (A) = A);
- -- Return True iff A is symmetric, see RM G.3.1 (90)
+ -- Return True iff A is symmetric, see RM G.3.1 (90).
function Is_Tiny (Value, Compared_To : Real) return Boolean is
(abs Compared_To + 100.0 * abs (Value) = abs Compared_To);
@@ -104,7 +104,7 @@ package body Ada.Numerics.Generic_Real_A
-- not a square matrix, and otherwise returns its length.
procedure Rotate (X, Y : in out Real; Sin, Tau : Real);
- -- Perform a Givens rotation of angle Theta given by sin and sin/(1 + cos)
+ -- Perform a Givens rotation
procedure Sort_Eigensystem
(Values : in out Real_Vector;
@@ -525,13 +525,13 @@ package body Ada.Numerics.Generic_Real_A
Vectors : out Real_Matrix;
Compute_Vectors : Boolean)
is
- -- This subprogram uses Carl Gustav Jacob Jacobi's cyclic iterative
- -- method for computing eigenvalues and eigenvectors and is based on
+ -- This subprogram uses Carl Gustav Jacob Jacobi's iterative method
+ -- for computing eigenvalues and eigenvectors and is based on
-- Rutishauser's implementation.
-- The given real symmetric matrix is transformed iteratively to
-- diagonal form through a sequence of appropriately chosen elementary
- -- orthogonal transformations, called Jacobi rotations.
+ -- orthogonal transformations, called Jacobi rotations here.
-- The Jacobi method produces a systematic decrease of the sum of the
-- squares of off-diagonal elements. Convergence to zero is quadratic,
@@ -542,44 +542,41 @@ package body Ada.Numerics.Generic_Real_A
-- best choice here, even though for large matrices other methods will
-- be significantly more efficient in both time and space.
- -- While the eigensystem computation is absolutely foolproof for all
+ -- While the eigensystem computations are absolutely foolproof for all
-- real symmetric matrices, in presence of invalid values, or similar
- -- exceptional situations, it may not be. In such cases, the results
- -- cannot be trusted and Constraint_Error is raised.
+ -- exceptional situations it might not. In such cases the results cannot
+ -- be trusted and Constraint_Error is raised.
-- Note: this implementation needs temporary storage for 2 * N + N**2
-- values of type Real.
- Max_Iterations : constant := 50;
- N : constant Natural := Length (A);
+ Max_Iterations : constant := 50;
+ N : constant Natural := Length (A);
subtype Square_Matrix is Real_Matrix (1 .. N, 1 .. N);
- -- In order to annihilate the M (Row, Col) element, the rotation angle
- -- Theta is chosen as follows:
+ -- In order to annihilate the M (Row, Col) element, the
+ -- rotation parameters Cos and Sin are computed as
+ -- follows:
- -- Cot (2.0 * Theta) = (Diag (Col) - Diag (Row)) / (2.0 * M (Row, Col))
+ -- Theta = Cot (2.0 * Phi)
+ -- = (Diag (Col) - Diag (Row)) / (2.0 * M (Row, Col))
- -- If C = Cot (2.0 * Theta), then Tan (Theta) is computed as the smaller
- -- root (in modulus) of:
+ -- Then Tan (Phi) as the smaller root (in modulus) of
- -- X**2 + 2 * C * X - 1 = 0
+ -- T**2 + 2 * T * Theta = 1 (or 0.5 / Theta, if Theta is large)
- -- or else as 0.5 / C, if C is large.
-
- function Compute_Tan (C : Real) return Real is
- (Real'Copy_Sign (1.0 / (abs C + Sqrt (1.0 + C**2)), C));
+ function Compute_Tan (Theta : Real) return Real is
+ (Real'Copy_Sign (1.0 / (abs Theta + Sqrt (1.0 + Theta**2)), Theta));
function Compute_Tan (P, H : Real) return Real is
- (if Is_Tiny (P, Compared_To => H)
- then P / H
- else Compute_Tan (C => H / (2.0 * P)));
+ (if Is_Tiny (P, Compared_To => H) then P / H
+ else Compute_Tan (Theta => H / (2.0 * P)));
pragma Annotate
(CodePeer, False_Positive, "divide by zero", "H, P /= 0");
function Sum_Strict_Upper (M : Square_Matrix) return Real;
- -- Return the sum of the absolute value of all the elements in the
- -- strict upper triangle of M.
+ -- Return the sum of all elements in the strict upper triangle of M
----------------------
-- Sum_Strict_Upper --
@@ -598,13 +595,11 @@ package body Ada.Numerics.Generic_Real_A
return Sum;
end Sum_Strict_Upper;
- -- Local variables
-
M : Square_Matrix := A; -- Work space for solving eigensystem
+ Threshold : Real;
+ Sum : Real;
Diag : Real_Vector (1 .. N);
Diag_Adj : Real_Vector (1 .. N);
- Sum : Real;
- Threshold : Real;
-- The vector Diag_Adj indicates the amount of change in each value,
-- while Diag tracks the value itself and Values holds the values as
@@ -626,24 +621,22 @@ package body Ada.Numerics.Generic_Real_A
raise Constraint_Error with "matrix not symmetric";
end if;
- Values := Diagonal (M);
-
-- Note: Only the locally declared matrix M and vectors (Diag, Diag_Adj)
-- have lower bound equal to 1. The Vectors matrix may have
-- different bounds, so take care indexing elements. Assignment
-- as a whole is fine as sliding is automatic in that case.
- Vectors := (if Compute_Vectors
- then Unit_Matrix (N)
- else [1 .. 0 => [1 .. 0 => 0.0]]);
+ Vectors := (if not Compute_Vectors then [1 .. 0 => [1 .. 0 => 0.0]]
+ else Unit_Matrix (Vectors'Length (1), Vectors'Length (2)));
+ Values := Diagonal (M);
Sweep : for Iteration in 1 .. Max_Iterations loop
- -- During the first three iterations, perform the rotation only for
- -- elements that are not much smaller than the average off-diagonal
- -- element. After this, rotate for any non-zero elements. After the
- -- fifth iteration, additionally zero out off-diagonal elements that
- -- are very small compared to elements on the diagonal with the same
+ -- The first three iterations, perform rotation for any non-zero
+ -- element. After this, rotate only for those that are not much
+ -- smaller than the average off-diagnal element. After the fifth
+ -- iteration, additionally zero out off-diagonal elements that are
+ -- very small compared to elements on the diagonal with the same
-- column or row index.
Sum := Sum_Strict_Upper (M);
@@ -652,8 +645,8 @@ package body Ada.Numerics.Generic_Real_A
Threshold := (if Iteration < 4 then 0.2 * Sum / Real (N**2) else 0.0);
- -- Iterate over all off-diagonal elements, rotating any that have an
- -- absolute value that exceeds the threshold.
+ -- Iterate over all off-diagonal elements, rotating any that have
+ -- an absolute value that exceeds the threshold.
Diag := Values;
Diag_Adj := [others => 0.0]; -- Accumulates adjustments to Diag
@@ -661,11 +654,11 @@ package body Ada.Numerics.Generic_Real_A
for Row in 1 .. N - 1 loop
for Col in Row + 1 .. N loop
- -- If, before the rotation, M (Row, Col) is tiny compared to
+ -- If, before the rotation M (Row, Col) is tiny compared to
-- Diag (Row) and Diag (Col), rotation is skipped. This is
-- meaningful, as it produces no larger error than would be
-- produced anyhow if the rotation had been performed.
- -- Suppress this optimization in the first four iterations, so
+ -- Suppress this optimization in the first four sweeps, so
-- that this procedure can be used for computing eigenvectors
-- of perturbed diagonal matrices.
@@ -677,8 +670,8 @@ package body Ada.Numerics.Generic_Real_A
elsif abs M (Row, Col) > Threshold then
Perform_Rotation : declare
- Tan : constant Real :=
- Compute_Tan (M (Row, Col), Diag (Col) - Diag (Row));
+ Tan : constant Real := Compute_Tan (M (Row, Col),
+ Diag (Col) - Diag (Row));
Cos : constant Real := 1.0 / Sqrt (1.0 + Tan**2);
Sin : constant Real := Tan * Cos;
Tau : constant Real := Sin / (1.0 + Cos);
@@ -717,7 +710,7 @@ package body Ada.Numerics.Generic_Real_A
Values := Values + Diag_Adj;
end loop Sweep;
- -- All normal matrices with valid values should converge perfectly
+ -- All normal matrices with valid values should converge perfectly.
if Sum /= 0.0 then
raise Constraint_Error with "eigensystem solution does not converge";

10
debian/patches/ada-perl-shebang.diff vendored Normal file
View File

@@ -0,0 +1,10 @@
# DP: Fix perl shebang for the gnathtml binary.
--- a/src/gcc/ada/gnathtml.pl
+++ b/src/gcc/ada/gnathtml.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/env perl
+#! /usr/bin/perl
#-----------------------------------------------------------------------------
#- --

498
debian/patches/ada-sjlj.diff vendored Normal file
View File

@@ -0,0 +1,498 @@
Autogen should refresh src/Makefile.in from src/Makefile.{def,tpl}
at build time, but we do not want to Build-Depend: guile.
# export QUILT_PATCHES=debian/patches
# quilt pop $this.diff
# quilt add src/Makefile.in
# (cd src && autogen Makefile.def)
# quilt refresh --no-timestamps --no-index -pab
# quilt push -a
--- /dev/null
+++ b/src/libada-sjlj/Makefile.in
@@ -0,0 +1,204 @@
+# Makefile for libada.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Default target; must be first.
+all: gnatlib
+ $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
+
+.PHONY: all
+
+## Multilib support variables.
+MULTISRCTOP =
+MULTIBUILDTOP =
+MULTIDIRS =
+MULTISUBDIR =
+MULTIDO = true
+MULTICLEAN = true
+
+# Standard autoconf-set variables.
+SHELL = @SHELL@
+srcdir = @srcdir@
+libdir = @libdir@
+build = @build@
+target = @target@
+prefix = @prefix@
+
+# Nonstandard autoconf-set variables.
+enable_shared = @enable_shared@
+
+LN_S=@LN_S@
+AWK=@AWK@
+
+ifeq (cp -p,$(LN_S))
+LN_S_RECURSIVE = cp -pR
+else
+LN_S_RECURSIVE = $(LN_S)
+endif
+
+# Variables for the user (or the top level) to override.
+objext=.o
+THREAD_KIND=native
+TRACE=no
+LDFLAGS=
+
+# The tedious process of getting CFLAGS right.
+CFLAGS=-g
+PICFLAG = @PICFLAG@
+GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
+GNATLIBCFLAGS= -g -O2
+GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
+ -fexceptions -DIN_RTS @have_getipinfo@ @have_capability@
+
+host_subdir = @host_subdir@
+GCC_DIR=$(MULTIBUILDTOP)../../$(host_subdir)/gcc
+
+target_noncanonical:=@target_noncanonical@
+version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
+libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)
+ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR))
+ADA_RTS_SUBDIR=./rts$(subst /,_,$(MULTISUBDIR))
+
+# exeext should not be used because it's the *host* exeext. We're building
+# a *target* library, aren't we?!? Likewise for CC. Still, provide bogus
+# definitions just in case something slips through the safety net provided
+# by recursive make invocations in gcc/ada/Makefile.in
+LIBADA_FLAGS_TO_PASS = \
+ "MAKEOVERRIDES=" \
+ "LDFLAGS=$(LDFLAGS) -Wl,--no-allow-shlib-undefined \
+ -Wl,--no-copy-dt-needed-entries -Wl,--no-undefined" \
+ "LN_S=$(LN_S)" \
+ "SHELL=$(SHELL)" \
+ "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS) -gnatn" \
+ "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \
+ "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \
+ "PICFLAG_FOR_TARGET=$(PICFLAG)" \
+ "THREAD_KIND=$(THREAD_KIND)" \
+ "TRACE=$(TRACE)" \
+ "MULTISUBDIR=$(MULTISUBDIR)" \
+ "libsubdir=$(libsubdir)" \
+ "objext=$(objext)" \
+ "prefix=$(prefix)" \
+ "exeext=.exeext.should.not.be.used " \
+ 'CC=the.host.compiler.should.not.be.needed' \
+ "GCC_FOR_TARGET=$(CC)" \
+ "CFLAGS=$(CFLAGS)" \
+ "RTSDIR=rts-sjlj"
+
+# Rules to build gnatlib.
+.PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared osconstool
+gnatlib: gnatlib-sjlj
+
+gnatlib-plain: osconstool $(GCC_DIR)/ada/Makefile
+ test -f stamp-libada || \
+ $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) gnatlib \
+ && touch stamp-libada
+ -rm -rf adainclude
+ -rm -rf adalib
+ $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adainclude
+ $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adalib
+
+gnatlib-sjlj gnatlib-zcx gnatlib-shared: osconstool $(GCC_DIR)/ada/Makefile
+ test -f stamp-libada || \
+ $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) $@ \
+ && touch stamp-libada-sjlj
+ -rm -rf adainclude
+ -rm -rf adalib
+ $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adainclude
+ $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adalib
+
+osconstool:
+ $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) ./bldtools/oscons/xoscons
+
+install-gnatlib: $(GCC_DIR)/ada/Makefile
+ $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) install-gnatlib-sjlj
+
+# Check uninstalled version.
+check:
+
+# Check installed version.
+installcheck:
+
+# Build info (none here).
+info:
+
+# Build DVI (none here).
+dvi:
+
+# Build PDF (none here).
+pdf:
+
+# Build html (none here).
+html:
+
+# Build TAGS (none here).
+TAGS:
+
+.PHONY: check installcheck info dvi pdf html
+
+# Installation rules.
+install: install-gnatlib
+ $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
+
+install-strip: install
+
+install-info:
+
+install-pdf:
+
+install-html:
+
+.PHONY: install install-strip install-info install-pdf install-html
+
+# Cleaning rules.
+mostlyclean:
+ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
+
+clean:
+ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
+
+distclean:
+ $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
+ $(RM) Makefile config.status config.log
+
+maintainer-clean:
+
+.PHONY: mostlyclean clean distclean maintainer-clean
+
+# Rules for rebuilding this Makefile.
+Makefile: $(srcdir)/Makefile.in config.status
+ CONFIG_FILES=$@ ; \
+ CONFIG_HEADERS= ; \
+ $(SHELL) ./config.status
+
+config.status: $(srcdir)/configure
+ $(SHELL) ./config.status --recheck
+
+AUTOCONF = autoconf
+configure_deps = \
+ $(srcdir)/configure.ac \
+ $(srcdir)/../config/acx.m4 \
+ $(srcdir)/../config/multi.m4 \
+ $(srcdir)/../config/override.m4 \
+ $(srcdir)/../config/picflag.m4 \
+ $(srcdir)/../config/unwind_ipinfo.m4
+
+$(srcdir)/configure: @MAINT@ $(configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+
+# Don't export variables to the environment, in order to not confuse
+# configure.
+.NOEXPORT:
--- /dev/null
+++ b/src/libada-sjlj/configure.ac
@@ -0,0 +1,156 @@
+# Configure script for libada.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+sinclude(../config/acx.m4)
+sinclude(../config/multi.m4)
+sinclude(../config/override.m4)
+sinclude(../config/picflag.m4)
+sinclude(../config/unwind_ipinfo.m4)
+
+AC_INIT
+AC_PREREQ([2.64])
+
+AC_CONFIG_SRCDIR([Makefile.in])
+
+# Determine the host, build, and target systems
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+target_alias=${target_alias-$host_alias}
+
+# Determine the noncanonical target name, for directory use.
+ACX_NONCANONICAL_TARGET
+
+# Determine the target- and build-specific subdirectories
+GCC_TOPLEV_SUBDIRS
+
+# Command-line options.
+# Very limited version of AC_MAINTAINER_MODE.
+AC_ARG_ENABLE([maintainer-mode],
+ [AC_HELP_STRING([--enable-maintainer-mode],
+ [enable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer])],
+ [case ${enable_maintainer_mode} in
+ yes) MAINT='' ;;
+ no) MAINT='#' ;;
+ *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
+ esac
+ maintainer_mode=${enableval}],
+ [MAINT='#'])
+AC_SUBST([MAINT])dnl
+
+AM_ENABLE_MULTILIB(, ..)
+# Calculate toolexeclibdir
+# Also toolexecdir, though it's only used in toolexeclibdir
+case ${enable_version_specific_runtime_libs} in
+ yes)
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ toolexecdir='$(libdir)/gcc/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
+ ;;
+ no)
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ # Install a library built with a cross compiler in tooldir, not libdir.
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/lib'
+ else
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ toolexeclibdir='$(libdir)'
+ fi
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+ esac
+ ;;
+esac
+AC_SUBST(toolexecdir)
+AC_SUBST(toolexeclibdir)
+#TODO: toolexeclibdir is currently disregarded
+
+# Check the compiler.
+# The same as in boehm-gc and libstdc++. Have to borrow it from there.
+# We must force CC to /not/ be precious variables; otherwise
+# the wrong, non-multilib-adjusted value will be used in multilibs.
+# As a side effect, we have to subst CFLAGS ourselves.
+
+m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
+m4_define([_AC_ARG_VAR_PRECIOUS],[])
+AC_PROG_CC
+m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+
+AC_SUBST(CFLAGS)
+
+AC_ARG_ENABLE([shared],
+[AC_HELP_STRING([--disable-shared],
+ [don't provide a shared libgnat])],
+[
+case $enable_shared in
+ yes | no) ;;
+ *)
+ enable_shared=no
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ case $pkg in
+ ada | libada)
+ enable_shared=yes ;;
+ esac
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+], [enable_shared=yes])
+AC_SUBST([enable_shared])
+
+GCC_PICFLAG
+AC_SUBST([PICFLAG])
+
+# These must be passed down, or are needed by gcc/libgcc.mvars
+AC_PROG_AWK
+AC_PROG_LN_S
+
+# Determine what to build for 'gnatlib'
+if test ${enable_shared} = yes; then
+ default_gnatlib_target="gnatlib-shared"
+else
+ default_gnatlib_target="gnatlib-plain"
+fi
+AC_SUBST([default_gnatlib_target])
+
+# Check for _Unwind_GetIPInfo
+GCC_CHECK_UNWIND_GETIPINFO
+if test x$have_unwind_getipinfo = xyes; then
+ have_getipinfo=-DHAVE_GETIPINFO
+else
+ have_getipinfo=
+fi
+AC_SUBST([have_getipinfo])
+
+# Check for <sys/capability.h>
+AC_CHECK_HEADER([sys/capability.h], have_capability=-DHAVE_CAPABILITY, have_capability=)
+AC_SUBST([have_capability])
+
+# Determine what GCC version number to use in filesystem paths.
+GCC_BASE_VER
+
+# Output: create a Makefile.
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
--- a/src/Makefile.def
+++ b/src/Makefile.def
@@ -194,6 +194,7 @@ target_modules = { module= libgnatvsn; n
missing= TAGS;
missing= install-info;
missing= installcheck; };
+target_modules = { module= libada-sjlj; };
target_modules = { module= libgomp; bootstrap= true; lib_path=.libs; };
target_modules = { module= libitm; lib_path=.libs; };
target_modules = { module= libatomic; lib_path=.libs; };
@@ -394,6 +395,7 @@ dependencies = { module=all-libcpp; on=a
dependencies = { module=all-fixincludes; on=all-libiberty; };
dependencies = { module=all-target-libada; on=all-gcc; };
+dependencies = { module=all-target-libada-sjlj; on=all-target-libada; };
dependencies = { module=all-gnattools; on=all-target-libada; };
dependencies = { module=all-gnattools; on=all-target-libstdc++-v3; };
dependencies = { module=all-gnattools; on=all-target-libgnat_util; };
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -167,6 +167,7 @@ target_libraries="target-libgcc \
target-libffi \
target-libobjc \
target-libada \
+ target-libada-sjlj \
${target_libiberty} \
target-libgnat_util \
target-libgo \
@@ -454,7 +455,7 @@ AC_ARG_ENABLE(libada,
ENABLE_LIBADA=$enableval,
ENABLE_LIBADA=yes)
if test "${ENABLE_LIBADA}" != "yes" ; then
- noconfigdirs="$noconfigdirs target-libgnat_util gnattools"
+ noconfigdirs="$noconfigdirs target-libgnat_util gnattools target-libada-sjlj"
fi
AC_ARG_ENABLE(libssp,
--- a/src/gcc/ada/gcc-interface/Makefile.in
+++ b/src/gcc/ada/gcc-interface/Makefile.in
@@ -193,7 +193,7 @@ GNAT_SRC=$(fsrcpfx)ada
# Multilib handling
MULTISUBDIR =
-RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
+RTSDIR := rts$(subst /,_,$(MULTISUBDIR))
# Link flags used to build gnat tools. By default we prefer to statically
# link with libgcc to avoid a dependency on shared libgcc (which is tricky
@@ -561,6 +561,26 @@ install-gnatlib: ../stamp-gnatlib-$(RTSD
cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
+install-gnatlib-sjlj: ../stamp-gnatlib-$(RTSDIR)
+# Create the directory before deleting it, in case the directory is
+# a list of directories (as it may be on VMS). This ensures we are
+# deleting the right one.
+ -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR_SJLJ)
+ -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR_SJLJ)
+ $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR_SJLJ)
+ $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR_SJLJ)
+ -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR_SJLJ)
+ -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR_SJLJ)
+ for file in $(RTSDIR)/*.ali; do \
+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR_SJLJ); \
+ done
+ # This copy must be done preserving the date on the original file.
+ for file in $(RTSDIR)/*.ad?; do \
+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR_SJLJ); \
+ done
+ cd $(DESTDIR)$(ADA_INCLUDE_DIR_SJLJ); $(CHMOD) a-wx *.adb
+ cd $(DESTDIR)$(ADA_INCLUDE_DIR_SJLJ); $(CHMOD) a-wx *.ads
+
../stamp-gnatlib2-$(RTSDIR):
$(RM) $(RTSDIR)/s-*.ali
$(RM) $(RTSDIR)/s-*$(objext)
@@ -826,6 +846,7 @@ gnatlib-shared:
gnatlib-sjlj:
$(MAKE) $(FLAGS_TO_PASS) \
EH_MECHANISM="" \
+ RTSDIR="$(RTSDIR)" \
MULTISUBDIR="$(MULTISUBDIR)" \
THREAD_KIND="$(THREAD_KIND)" \
../stamp-gnatlib1-$(RTSDIR)
@@ -835,6 +856,7 @@ gnatlib-sjlj:
$(RTSDIR)/system.ads > $(RTSDIR)/s.ads
$(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
$(MAKE) $(FLAGS_TO_PASS) \
+ RTSDIR="$(RTSDIR)" \
EH_MECHANISM="" \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
@@ -889,6 +911,8 @@ b_gnatm.o : b_gnatm.adb
ADA_INCLUDE_DIR = $(libsubdir)/adainclude
ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
+ADA_INCLUDE_DIR_SJLJ = $(libsubdir)/rts-sjlj/adainclude
+ADA_RTL_OBJ_DIR_SJLJ = $(libsubdir)/rts-sjlj/adalib
# Special flags
--- a/src/gcc/ada/gcc-interface/config-lang.in
+++ b/src/gcc/ada/gcc-interface/config-lang.in
@@ -43,8 +43,8 @@ if test "x$cross_compiling/$build/$host"
lang_requires="c c++"
fi
-target_libs="target-libada target-libgnat_util"
-lang_dirs="libada gnattools"
+target_libs="target-libada target-libgnat_util target-libada-sjlj"
+lang_dirs="libada gnattools libada-sjlj"
# Ada is not enabled by default for the time being.
build_by_default=no
--- a/src/gcc/ada/gcc-interface/Make-lang.in
+++ b/src/gcc/ada/gcc-interface/Make-lang.in
@@ -837,6 +837,7 @@ ada.install-common:
install-gnatlib:
$(MAKE) -C ada $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib$(LIBGNAT_TARGET)
+ $(MAKE) -C ada $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) RTSDIR="rts-sjlj" install-gnatlib-sjlj$(LIBGNAT_TARGET)
install-gnatlib-obj:
$(MAKE) -C ada $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) install-gnatlib-obj

17
debian/patches/ada-tv_nsec-size.diff vendored Normal file
View File

@@ -0,0 +1,17 @@
--- a/src/gcc/ada/s-oscons-tmplt.c
+++ b/src/gcc/ada/s-oscons-tmplt.c
@@ -1769,9 +1769,12 @@ CNS(MAX_tv_sec, "")
struct timespec ts;
/*
-- Sizes (in bytes) of the components of struct timespec.
- -- The tv_sec field is the same than in struct timeval.
+ -- The tv_sec component is the same size as in struct timeval.
+ -- In order to avoid the endian issues in the glibc __timespec64
+ -- struct, we use the same size for the tv_nsec component as the
+ -- tv_sec component.
*/
-#define SIZEOF_tv_nsec (sizeof (ts.tv_nsec))
+#define SIZEOF_tv_nsec (sizeof (ts.tv_sec))
CND(SIZEOF_tv_nsec, "tv_nsec");
}

36
debian/patches/ada-verbose.diff vendored Normal file
View File

@@ -0,0 +1,36 @@
Description: Display subprocess command lines when building Ada.
The log can be a page longer if it helps debugging.
Forwarded: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87778
Author: Nicolas Boulenguez <nicolas@debian.org>
--- a/src/gcc/ada/Make-generated.in
+++ b/src/gcc/ada/Make-generated.in
@@ -18,7 +18,7 @@ GEN_IL_FLAGS = -gnata -gnat2012 -gnatw.g
ada/seinfo_tables.ads ada/seinfo_tables.adb ada/sinfo.h ada/einfo.h ada/nmake.ads ada/nmake.adb ada/seinfo.ads ada/sinfo-nodes.ads ada/sinfo-nodes.adb ada/einfo-entities.ads ada/einfo-entities.adb: ada/stamp-gen_il ; @true
ada/stamp-gen_il: $(fsrcdir)/ada/gen_il*
$(MKDIR) ada/gen_il
- cd ada/gen_il; $(GNATMAKE) -q -g $(GEN_IL_FLAGS) gen_il-main
+ cd ada/gen_il; $(GNATMAKE) -v -g $(GEN_IL_FLAGS) gen_il-main
# Ignore errors to work around finalization issues in older compilers
- cd ada/gen_il; ./gen_il-main
$(fsrcdir)/../move-if-change ada/gen_il/seinfo_tables.ads ada/seinfo_tables.ads
@@ -46,7 +46,7 @@ ada/stamp-snames : ada/snames.ads-tmpl a
-$(MKDIR) ada/bldtools/snamest
$(RM) $(addprefix ada/bldtools/snamest/,$(notdir $^))
$(CP) $^ ada/bldtools/snamest
- cd ada/bldtools/snamest && $(GNATMAKE) -q xsnamest && ./xsnamest
+ cd ada/bldtools/snamest && $(GNATMAKE) -v xsnamest && ./xsnamest
$(fsrcdir)/../move-if-change ada/bldtools/snamest/snames.ns ada/snames.ads
$(fsrcdir)/../move-if-change ada/bldtools/snamest/snames.nb ada/snames.adb
$(fsrcdir)/../move-if-change ada/bldtools/snamest/snames.nh ada/snames.h
--- a/src/gcc/ada/gcc-interface/Makefile.in
+++ b/src/gcc/ada/gcc-interface/Makefile.in
@@ -621,7 +621,7 @@ OSCONS_EXTRACT=$(GCC_FOR_ADA_RTS) $(GNAT
-$(MKDIR) ./bldtools/oscons
$(RM) $(addprefix ./bldtools/oscons/,$(notdir $^))
$(CP) $^ ./bldtools/oscons
- (cd ./bldtools/oscons ; gnatmake -q xoscons)
+ (cd ./bldtools/oscons ; gnatmake -v xoscons)
$(RTSDIR)/s-oscons.ads: ../stamp-gnatlib1-$(RTSDIR) s-oscons-tmplt.c gsocket.h ./bldtools/oscons/xoscons
$(RM) $(RTSDIR)/s-oscons-tmplt.i $(RTSDIR)/s-oscons-tmplt.s

24
debian/patches/alpha-ieee-doc.diff vendored Normal file
View File

@@ -0,0 +1,24 @@
# DP: #212912
# DP: on alpha-linux, make -mieee default and add -mieee-disable switch
# DP: to turn default off (doc patch)
---
gcc/doc/invoke.texi | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
--- a/src/gcc/doc/invoke.texi
+++ b/src/gcc/doc/invoke.texi
@@ -25470,6 +25470,13 @@ able to correctly support denormalized n
values such as not-a-number and plus/minus infinity. Other Alpha
compilers call this option @option{-ieee_with_no_inexact}.
+DEBIAN SPECIFIC: This option is on by default for alpha-linux-gnu, unless
+@option{-ffinite-math-only} (which is part of the @option{-ffast-math}
+set) is specified, because the software functions in the GNU libc math
+libraries generate denormalized numbers, NaNs, and infs (all of which
+will cause a programs to SIGFPE when it attempts to use the results without
+@option{-mieee}).
+
@opindex mieee-with-inexact
@item -mieee-with-inexact
This is like @option{-mieee} except the generated code also maintains

17
debian/patches/alpha-ieee.diff vendored Normal file
View File

@@ -0,0 +1,17 @@
# DP: #212912
# DP: on alpha-linux, make -mieee default and add -mieee-disable switch
# DP: to turn default off
--- a/src/gcc/config/alpha/alpha.cc
+++ b/src/gcc/config/alpha/alpha.cc
@@ -384,6 +384,10 @@ alpha_option_override (void)
int line_size = 0, l1_size = 0, l2_size = 0;
int i;
+ /* If not -ffinite-math-only, enable -mieee*/
+ if (!flag_finite_math_only)
+ target_flags |= MASK_IEEE|MASK_IEEE_CONFORMANT;
+
#ifdef SUBTARGET_OVERRIDE_OPTIONS
SUBTARGET_OVERRIDE_OPTIONS;
#endif

View File

@@ -0,0 +1,30 @@
# DP: never emit .ev4 directive.
---
gcc/config/alpha/alpha.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
--- a/src/gcc/config/alpha/alpha.cc
+++ b/src/gcc/config/alpha/alpha.cc
@@ -9494,7 +9494,7 @@ alpha_file_start (void)
fputs ("\t.set nomacro\n", asm_out_file);
if (TARGET_SUPPORT_ARCH | TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX)
{
- const char *arch;
+ const char *arch = NULL;
if (alpha_cpu == PROCESSOR_EV6 || TARGET_FIX || TARGET_CIX)
arch = "ev6";
@@ -9504,10 +9504,9 @@ alpha_file_start (void)
arch = "ev56";
else if (alpha_cpu == PROCESSOR_EV5)
arch = "ev5";
- else
- arch = "ev4";
- fprintf (asm_out_file, "\t.arch %s\n", arch);
+ if (arch)
+ fprintf (asm_out_file, "\t.arch %s\n", arch);
}
}

29
debian/patches/arc-stddef.diff vendored Normal file
View File

@@ -0,0 +1,29 @@
--- a/src/gcc/config/arc/arc-arch.h
+++ b/src/gcc/config/arc/arc-arch.h
@@ -22,6 +22,8 @@ along with GCC; see the file COPYING3.
#ifndef GCC_ARC_ARCH_H
#define GCC_ARC_ARCH_H
+#include <stddef.h>
+
#ifndef IN_LIBGCC2
/* Architecture selection types. */
@@ -116,7 +118,7 @@ typedef struct
} arc_cpu_t;
-const arc_arch_t arc_arch_types[] =
+static const arc_arch_t arc_arch_types[] =
{
{"none", BASE_ARCH_NONE, 0, 0},
#define ARC_ARCH(NAME, ARCH, FLAGS, DFLAGS) \
@@ -126,7 +128,7 @@ const arc_arch_t arc_arch_types[] =
{NULL, BASE_ARCH_END, 0, 0}
};
-const arc_cpu_t arc_cpu_types[] =
+static const arc_cpu_t arc_cpu_types[] =
{
{"none", NULL, PROCESSOR_NONE, 0, HAS_NONE, ARC_TUNE_NONE},
#define ARC_CPU(NAME, ARCH, FLAGS, EXTRA, TUNE) \

View File

@@ -0,0 +1,88 @@
# DP: Set MULTILIB_DEFAULTS for ARM multilib builds
--- a/src/gcc/config.gcc
+++ b/src/gcc/config.gcc
@@ -4342,10 +4342,18 @@ case "${target}" in
done
case "$with_float" in
- "" \
- | soft | hard | softfp)
+ "")
# OK
;;
+ soft)
+ tm_defines="${tm_defines} TARGET_CONFIGURED_FLOAT_ABI=0"
+ ;;
+ softfp)
+ tm_defines="${tm_defines} TARGET_CONFIGURED_FLOAT_ABI=1"
+ ;;
+ hard)
+ tm_defines="${tm_defines} TARGET_CONFIGURED_FLOAT_ABI=2"
+ ;;
*)
echo "Unknown floating point type used in --with-float=$with_float" 1>&2
exit 1
@@ -4380,6 +4388,9 @@ case "${target}" in
"" \
| arm | thumb )
#OK
+ if test "$with_mode" = thumb; then
+ tm_defines="${tm_defines} TARGET_CONFIGURED_THUMB_MODE=1"
+ fi
;;
*)
echo "Unknown mode used in --with-mode=$with_mode"
--- a/src/gcc/config/arm/linux-eabi.h
+++ b/src/gcc/config/arm/linux-eabi.h
@@ -37,7 +37,21 @@
target hardware. If you override this to use the hard-float ABI then
change the setting of GLIBC_DYNAMIC_LINKER_DEFAULT as well. */
#undef TARGET_DEFAULT_FLOAT_ABI
+#ifdef TARGET_CONFIGURED_FLOAT_ABI
+#if TARGET_CONFIGURED_FLOAT_ABI == 2
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
+#define MULTILIB_DEFAULT_FLOAT_ABI "mfloat-abi=hard"
+#elif TARGET_CONFIGURED_FLOAT_ABI == 1
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFTFP
+#define MULTILIB_DEFAULT_FLOAT_ABI "mfloat-abi=softfp"
+#else
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
+#define MULTILIB_DEFAULT_FLOAT_ABI "mfloat-abi=soft"
+#endif
+#else
#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
+#define MULTILIB_DEFAULT_FLOAT_ABI "mfloat-abi=soft"
+#endif
/* We default to the "aapcs-linux" ABI so that enums are int-sized by
default. */
@@ -91,6 +105,28 @@
#define MUSL_DYNAMIC_LINKER \
"/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1"
+/* Set the multilib defaults according the configuration, needed to
+ let gcc -print-multi-dir do the right thing. */
+
+#if TARGET_BIG_ENDIAN_DEFAULT
+#define MULTILIB_DEFAULT_ENDIAN "mbig-endian"
+#else
+#define MULTILIB_DEFAULT_ENDIAN "mlittle-endian"
+#endif
+
+#ifndef TARGET_CONFIGURED_THUMB_MODE
+#define MULTILIB_DEFAULT_MODE "marm"
+#elif TARGET_CONFIGURED_THUMB_MODE == 1
+#define MULTILIB_DEFAULT_MODE "mthumb"
+#else
+#define MULTILIB_DEFAULT_MODE "marm"
+#endif
+
+#undef MULTILIB_DEFAULTS
+#define MULTILIB_DEFAULTS \
+ { MULTILIB_DEFAULT_MODE, MULTILIB_DEFAULT_ENDIAN, \
+ MULTILIB_DEFAULT_FLOAT_ABI, "mno-thumb-interwork" }
+
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
use the GNU/Linux version, not the generic BPABI version. */
#undef LINK_SPEC

View File

@@ -0,0 +1,26 @@
--- a/src/gcc/config/arm/t-linux-eabi
+++ b/src/gcc/config/arm/t-linux-eabi
@@ -24,6 +24,23 @@
MULTILIB_OPTIONS =
MULTILIB_DIRNAMES =
+ifneq (,$(findstring MULTIARCH_DEFAULTS,$(tm_defines)))
+ifneq (,$(findstring __arm_linux_gnueabi__,$(tm_defines)))
+ MULTILIB_OPTIONS = mfloat-abi=softfp/mfloat-abi=hard/mfloat-abi=soft
+ MULTILIB_DIRNAMES = . hf soft-float
+ MULTILIB_EXCEPTIONS =
+ MULTILIB_MATCHES = mfloat-abi?hard=mhard-float mfloat-abi?soft=msoft-float
+ MULTILIB_OSDIRNAMES = ../../lib/arm-linux-gnueabi ../../lib/arm-linux-gnueabihf soft-float
+endif
+ifneq (,$(findstring __arm_linux_gnueabihf__,$(tm_defines)))
+ MULTILIB_OPTIONS = mfloat-abi=hard/mfloat-abi=softfp/mfloat-abi=soft
+ MULTILIB_DIRNAMES = . sf soft-float
+ MULTILIB_EXCEPTIONS =
+ MULTILIB_MATCHES = mfloat-abi?hard=mhard-float mfloat-abi?soft=msoft-float
+ MULTILIB_OSDIRNAMES = ../../lib/arm-linux-gnueabihf ../../lib/arm-linux-gnueabi soft-float
+endif
+endif
+
#MULTILIB_OPTIONS += mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te
#MULTILIB_DIRNAMES += fa606te fa626te fmp626 fa726te
#MULTILIB_EXCEPTIONS += *mthumb/*mcpu=fa606te *mthumb/*mcpu=fa626te *mthumb/*mcpu=fmp626 *mthumb/*mcpu=fa726te*

72
debian/patches/binutils-pr32491.diff vendored Normal file
View File

@@ -0,0 +1,72 @@
From thiago.bauermann@linaro.org Fri Dec 27 21:47:56 2024
From: thiago.bauermann@linaro.org (Thiago Jung Bauermann)
Date: Fri, 27 Dec 2024 18:47:56 -0300
Subject: [PATCH] gcc/configure: Fix check for assembler section merging
support on Arm
Message-ID: <20241227214756.1059146-1-thiago.bauermann@linaro.org>
In 32-bit Arm assembly, the @ character is the start of a comment so
the section type needs to use the % character instead.
configure.ac attempts to account for this difference by doing a second
try when checking the assembler for section merging support.
Unfortunately there is a bug: because the gcc_GAS_CHECK_FEATURE macro
has a call to AC_CACHE_CHECK, it will actually skip the second try
because the gcc_cv_as_shf_merge variable has already been set:
checking assembler for section merging support... no
checking assembler for section merging support... (cached) no
Fix by using a separate variable for the second try, as is done in the
check for COMDAT group support.
This problem was noticed because the recent binutils commit
d5cbf916be4a ("gas/ELF: also reject merge entity size being zero") caused
gas to be stricter about mergeable sections without an entity size:
configure:27013: checking assembler for section merging support
configure:27022: /path/to/as --fatal-warnings -o conftest.o conftest.s >&5
conftest.s: Assembler messages:
conftest.s:1: Warning: invalid merge / string entity size
conftest.s: Error: 1 warning, treating warnings as errors
configure:27025: $? = 1
configure: failed program was
.section .rodata.str, "aMS", @progbits, 1
configure:27036: result: no
In previous versions of gas the conftest.s program above was accepted
and configure detected support for section merging.
See also:
https://linaro.atlassian.net/browse/GNU-1427
https://sourceware.org/bugzilla/show_bug.cgi?id=32491
Tested on armv8l-linux-gnueabihf.
gcc/ChangeLog:
* configure.ac: Fix check for HAVE_GAS_SHF_MERGE on Arm targets.
* configure: Regenerate.
---
gcc/configure | 17 +++++++++--------
gcc/configure.ac | 6 ++++--
2 files changed, 13 insertions(+), 10 deletions(-)
--- a/src/gcc/configure.ac
+++ b/src/gcc/configure.ac
@@ -3606,12 +3606,14 @@ gcc_GAS_CHECK_FEATURE(section merging su
[--fatal-warnings],
[.section .rodata.str, "aMS", @progbits, 1])
if test $gcc_cv_as_shf_merge = no; then
- gcc_GAS_CHECK_FEATURE(section merging support, gcc_cv_as_shf_merge,
+ gcc_GAS_CHECK_FEATURE(section merging support (%progbits),
+ gcc_cv_as_shf_merge_percent,
[--fatal-warnings],
[.section .rodata.str, "aMS", %progbits, 1])
fi
AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE,
- [`if test $gcc_cv_as_shf_merge = yes; then echo 1; else echo 0; fi`],
+ [`if test $gcc_cv_as_shf_merge = yes \
+ || test $gcc_cv_as_shf_merge_percent = yes; then echo 1; else echo 0; fi`],
[Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.])
gcc_cv_ld_aligned_shf_merge=yes

View File

@@ -0,0 +1,30 @@
# DP: For bootstrap builds, don't build unneeded libstdc++ things
# DP: (debug library, PCH headers).
# Please read ada-changes-in-autogen-output.diff about src/Makefile.[def|tpl].
--- a/src/Makefile.tpl
+++ b/src/Makefile.tpl
@@ -1060,7 +1060,9 @@
--target=[+target_alias+] $${srcdiroption} [+ IF prev +]\
--with-build-libsubdir=$(HOST_SUBDIR) [+ ENDIF prev +]\
$(STAGE[+id+]_CONFIGURE_FLAGS)[+ IF extra_configure_flags +] \
- [+extra_configure_flags+][+ ENDIF extra_configure_flags +]
+ [+extra_configure_flags+][+ ENDIF extra_configure_flags +] \
+ [+ IF bootstrap_configure_flags +][+bootstrap_configure_flags+] \
+ [+ ENDIF bootstrap_configure_flags +]
@endif [+prefix+][+module+]-bootstrap
[+ ENDFOR bootstrap_stage +]
[+ ENDIF bootstrap +]
--- a/src/Makefile.def
+++ b/src/Makefile.def
@@ -117,7 +117,8 @@
target_modules = { module= libstdc++-v3;
bootstrap=true;
lib_path=src/.libs;
- raw_cxx=true; };
+ raw_cxx=true;
+ bootstrap_configure_flags='--disable-libstdcxx-debug --disable-libstdcxx-pch'; };
target_modules = { module= libmudflap; lib_path=.libs; };
target_modules = { module= libsanitizer; lib_path=.libs; };
target_modules = { module= libssp; lib_path=.libs; };

34
debian/patches/canonical-cpppath.diff vendored Normal file
View File

@@ -0,0 +1,34 @@
# DP: Don't use any relative path names for the standard include paths.
--- a/src/gcc/incpath.cc
+++ b/src/gcc/incpath.cc
@@ -177,6 +177,14 @@ add_standard_paths (const char *sysroot,
str = reconcat (str, str, dir_separator_str,
imultiarch, NULL);
}
+ {
+ char *rp = lrealpath (str);
+ if (rp)
+ {
+ free (str);
+ str = rp;
+ }
+ }
add_path (str, INC_SYSTEM, p->cxx_aware, false);
}
}
@@ -252,6 +260,14 @@ add_standard_paths (const char *sysroot,
else
str = reconcat (str, str, dir_separator_str, imultiarch, NULL);
}
+ {
+ char *rp = lrealpath (str);
+ if (rp)
+ {
+ free (str);
+ str = rp;
+ }
+ }
add_path (str, INC_SYSTEM, p->cxx_aware, false);
}

52
debian/patches/config-ml.diff vendored Normal file
View File

@@ -0,0 +1,52 @@
# DP: - Disable some biarch libraries for biarch builds.
# DP: - Fix multilib builds on kernels which don't support all multilibs.
--- a/src/config-ml.in
+++ b/src/config-ml.in
@@ -488,6 +488,25 @@ powerpc*-*-* | rs6000*-*-*)
;;
esac
+if [ -z "$biarch_multidir_names" ]; then
+ biarch_multidir_names="libiberty libstdc++-v3 libgfortran libmudflap libssp libffi libobjc libgomp"
+ echo "WARNING: biarch_multidir_names is unset. Use default value:"
+ echo " $biarch_multidir_names"
+fi
+ml_srcbase=`basename $ml_realsrcdir`
+old_multidirs="${multidirs}"
+multidirs=""
+for x in ${old_multidirs}; do
+ case " $x " in
+ " 32 "|" n32 "|" x32 "|" 64 "|" hf "|" sf "|" m4-nofpu ")
+ case "$biarch_multidir_names" in
+ *"$ml_srcbase"*) multidirs="${multidirs} ${x}" ;;
+ esac
+ ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+done
+
# Remove extraneous blanks from multidirs.
# Tests like `if [ -n "$multidirs" ]' require it.
multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'`
@@ -886,9 +905,19 @@ if [ -n "${multidirs}" ] && [ -z "${ml_n
fi
fi
+ ml_configure_args=
+ for arg in ${ac_configure_args}
+ do
+ case $arg in
+ *CC=*) ml_configure_args=${ml_config_env} ;;
+ *CXX=*) ml_configure_args=${ml_config_env} ;;
+ *) ;;
+ esac
+ done
+
if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
--with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
- "${ac_configure_args}" ${ml_config_env} ${ml_srcdiroption} ; then
+ "${ac_configure_args}" ${ml_configure_args} ${ml_config_env} ${ml_srcdiroption} ; then
true
else
exit 1

89
debian/patches/cross-biarch.diff vendored Normal file
View File

@@ -0,0 +1,89 @@
# DP: Fix the location of target's libs in cross-build for biarch
--- a/src/config-ml.in
+++ b/src/config-ml.in
@@ -533,7 +533,13 @@ multi-do:
else \
if [ -d ../$${dir}/$${lib} ]; then \
flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
- if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
+ libsuffix_="$${dir}"; \
+ if [ "$${dir}" = "n32" ]; then libsuffix_=32; fi; \
+ if [ -n "$$($${compiler} -v 2>&1 |grep '^Target: mips')" ] && [ "$${dir}" = "32" ]; then libsuffix_=o32; fi; \
+ if (cd ../$${dir}/$${lib}; $(MAKE) $(subst \
+ -B$(build_tooldir)/lib/, \
+ -B$(build_tooldir)/lib$${libsuffix_}/, \
+ $(FLAGS_TO_PASS)) \
CFLAGS="$(CFLAGS) $${flags}" \
CCASFLAGS="$(CCASFLAGS) $${flags}" \
FCFLAGS="$(FCFLAGS) $${flags}" \
@@ -786,6 +792,15 @@ if [ -n "${multidirs}" ] && [ -z "${ml_n
GOC_=$GOC' '
GDC_=$GDC' '
else
+ if [ "${ml_dir}" = "." ]; then
+ FILTER_="s!X\\(.*\\)!\\1!p"
+ elif [ "${ml_dir}" = "n32" ]; then # mips n32 -> lib32
+ FILTER_="s!X\\(.*\\)/!\\132/!p"
+ elif [ "${ml_dir}" = "32" ] && [ "$(echo ${host} |grep '^mips')" ]; then # mips o32 -> libo32
+ FILTER_="s!X\\(.*\\)/!\\1o32/!p"
+ else
+ FILTER_="s!X\\(.*\\)/!\\1${ml_dir}/!p"
+ fi
# Create a regular expression that matches any string as long
# as ML_POPDIR.
popdir_rx=`echo "${ML_POPDIR}" | sed 's,.,.,g'`
@@ -794,6 +809,8 @@ if [ -n "${multidirs}" ] && [ -z "${ml_n
case $arg in
-[BIL]"${ML_POPDIR}"/*)
CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\1/p"`' ' ;;
+ -B*/lib/)
+ CC_="${CC_}"`echo "X${arg}" | sed -n "$FILTER_"`' ' ;;
"${ML_POPDIR}"/*)
CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)
@@ -806,6 +823,8 @@ if [ -n "${multidirs}" ] && [ -z "${ml_n
case $arg in
-[BIL]"${ML_POPDIR}"/*)
CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ -B*/lib/)
+ CXX_="${CXX_}"`echo "X${arg}" | sed -n "$FILTER_"`' ' ;;
"${ML_POPDIR}"/*)
CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)
@@ -818,6 +837,8 @@ if [ -n "${multidirs}" ] && [ -z "${ml_n
case $arg in
-[BIL]"${ML_POPDIR}"/*)
F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ -B*/lib/)
+ F77_="${F77_}"`echo "X${arg}" | sed -n "$FILTER_"`' ' ;;
"${ML_POPDIR}"/*)
F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)
@@ -830,6 +851,8 @@ if [ -n "${multidirs}" ] && [ -z "${ml_n
case $arg in
-[BIL]"${ML_POPDIR}"/*)
GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ -B*/lib/)
+ GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "$FILTER_"`' ' ;;
"${ML_POPDIR}"/*)
GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)
@@ -842,6 +865,8 @@ if [ -n "${multidirs}" ] && [ -z "${ml_n
case $arg in
-[BIL]"${ML_POPDIR}"/*)
GOC_="${GOC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ -B*/lib/)
+ GOC_="${GOC_}"`echo "X${arg}" | sed -n "$FILTER_"`' ' ;;
"${ML_POPDIR}"/*)
GOC_="${GOC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)
@@ -854,6 +879,8 @@ if [ -n "${multidirs}" ] && [ -z "${ml_n
case $arg in
-[BIL]"${ML_POPDIR}"/*)
GDC_="${GDC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ -B*/lib/)
+ GDC_="${GDC_}"`echo "X${arg}" | sed -n "$FILTER_"`' ' ;;
"${ML_POPDIR}"/*)
GDC_="${GDC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
*)

57
debian/patches/cross-fixes.diff vendored Normal file
View File

@@ -0,0 +1,57 @@
# DP: Fix the linker error when creating an xcc for ia64
---
gcc/config/ia64/fde-glibc.c | 3 +++
gcc/config/ia64/unwind-ia64.c | 3 ++-
gcc/unwind-compat.c | 2 ++
gcc/unwind-generic.h | 2 ++
6 files changed, 14 insertions(+), 1 deletions(-)
--- a/src/libgcc/config/ia64/unwind-ia64.c
+++ b/src/libgcc/config/ia64/unwind-ia64.c
@@ -26,6 +26,7 @@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
+#ifndef inhibit_libc
#include "tconfig.h"
#include "tsystem.h"
#include "coretypes.h"
@@ -2467,3 +2468,4 @@ alias (_Unwind_SetIP);
#endif
#endif
+#endif
--- a/src/libgcc/unwind-compat.c
+++ b/src/libgcc/unwind-compat.c
@@ -23,6 +23,7 @@
<http://www.gnu.org/licenses/>. */
#if defined (USE_GAS_SYMVER) && defined (USE_LIBUNWIND_EXCEPTIONS)
+#ifndef inhibit_libc
#include "tconfig.h"
#include "tsystem.h"
#include "unwind.h"
@@ -207,3 +208,4 @@ _Unwind_SetIP (struct _Unwind_Context *c
}
symver (_Unwind_SetIP, GCC_3.0);
#endif
+#endif
--- a/src/libgcc/unwind-generic.h
+++ b/src/libgcc/unwind-generic.h
@@ -221,6 +221,7 @@ _Unwind_SjLj_Resume_or_Rethrow (struct _
compatible with the standard ABI for IA-64, we inline these. */
#ifdef __ia64__
+#ifndef inhibit_libc
static inline _Unwind_Ptr
_Unwind_GetDataRelBase (struct _Unwind_Context *_C)
{
@@ -237,6 +238,7 @@ _Unwind_GetTextRelBase (struct _Unwind_C
/* @@@ Retrieve the Backing Store Pointer of the given context. */
extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
+#endif /* inhibit_libc */
#else
extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);

View File

@@ -0,0 +1,497 @@
--- a/src/fixincludes/Makefile.in
+++ b/src/fixincludes/Makefile.in
@@ -52,9 +52,9 @@ target_noncanonical:=@target_noncanonica
gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_noncanonical)/$(gcc_version)
# Directory in which the compiler finds executables
-libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
+libexecsubdir = $(libexecdir)/gcc-cross/$(target_noncanonical)/$(gcc_version)
# Where our executable files go
itoolsdir = $(libexecsubdir)/install-tools
# Where our data files go
--- a/src/libgfortran/Makefile.in
+++ b/src/libgfortran/Makefile.in
@@ -750,7 +750,7 @@ gcc_version := $(shell @get_gcc_base_ver
@LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = gfortran.ver
@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = gfortran.ver-sun gfortran.ver
gfor_c_HEADERS = ISO_Fortran_binding.h
-gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+gfor_cdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
$(lt_host_flags)
@@ -765,12 +765,12 @@ libgfortran_la_LDFLAGS = -version-info `
libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP)
cafexeclib_LTLIBRARIES = libcaf_single.la
-cafexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
+cafexeclibdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
libcaf_single_la_SOURCES = caf/single.c
libcaf_single_la_LDFLAGS = -static
libcaf_single_la_DEPENDENCIES = caf/libcaf.h
libcaf_single_la_LINK = $(LINK) $(libcaf_single_la_LDFLAGS)
-@IEEE_SUPPORT_TRUE@fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude
+@IEEE_SUPPORT_TRUE@fincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude
@IEEE_SUPPORT_TRUE@nodist_finclude_HEADERS = ieee_arithmetic.mod ieee_exceptions.mod ieee_features.mod
AM_CPPFLAGS = -iquote$(srcdir)/io -I$(srcdir)/$(MULTISRCTOP)../gcc \
-I$(srcdir)/$(MULTISRCTOP)../gcc/config $(LIBQUADINCLUDE) \
--- a/src/libgfortran/Makefile.am
+++ b/src/libgfortran/Makefile.am
@@ -39,7 +39,7 @@ version_dep =
endif
gfor_c_HEADERS = ISO_Fortran_binding.h
-gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+gfor_cdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
$(lt_host_flags)
@@ -55,14 +55,14 @@ libgfortran_la_LDFLAGS = -version-info `
libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP)
cafexeclib_LTLIBRARIES = libcaf_single.la
-cafexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
+cafexeclibdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
libcaf_single_la_SOURCES = caf/single.c
libcaf_single_la_LDFLAGS = -static
libcaf_single_la_DEPENDENCIES = caf/libcaf.h
libcaf_single_la_LINK = $(LINK) $(libcaf_single_la_LDFLAGS)
if IEEE_SUPPORT
-fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude
+fincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude
nodist_finclude_HEADERS = ieee_arithmetic.mod ieee_exceptions.mod ieee_features.mod
endif
--- a/src/lto-plugin/Makefile.in
+++ b/src/lto-plugin/Makefile.in
@@ -342,7 +342,7 @@ with_libiberty = @with_libiberty@
ACLOCAL_AMFLAGS = -I .. -I ../config
AUTOMAKE_OPTIONS = no-dependencies
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
-libexecsubdir := $(libexecdir)/gcc/$(real_target_noncanonical)/$(gcc_version)$(accel_dir_suffix)
+libexecsubdir := $(libexecdir)/gcc-cross/$(real_target_noncanonical)/$(gcc_version)$(accel_dir_suffix)
AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS)
AM_CFLAGS = @ac_lto_plugin_warn_cflags@ $(CET_HOST_FLAGS) -DBASE_VERSION='"$(gcc_version)"'
AM_LDFLAGS = @ac_lto_plugin_ldflags@ @ac_lto_plugin_extra_ldflags@
--- a/src/lto-plugin/Makefile.am
+++ b/src/lto-plugin/Makefile.am
@@ -5,7 +5,7 @@ AUTOMAKE_OPTIONS = no-dependencies
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
target_noncanonical := @target_noncanonical@
-libexecsubdir := $(libexecdir)/gcc/$(real_target_noncanonical)/$(gcc_version)$(accel_dir_suffix)
+libexecsubdir := $(libexecdir)/gcc-cross/$(real_target_noncanonical)/$(gcc_version)$(accel_dir_suffix)
AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS)
AM_CFLAGS = @ac_lto_plugin_warn_cflags@ $(CET_HOST_FLAGS) -DBASE_VERSION='"$(gcc_version)"'
--- a/src/libitm/Makefile.in
+++ b/src/libitm/Makefile.in
@@ -459,7 +459,7 @@ SUBDIRS = testsuite
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
abi_version = -fabi-version=4
search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) $(top_srcdir)
-libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+libsubincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include
AM_CPPFLAGS = $(addprefix -I, $(search_path))
AM_CFLAGS = $(XCFLAGS)
AM_CXXFLAGS = $(XCFLAGS) -std=gnu++0x -funwind-tables -fno-exceptions \
--- a/src/libitm/Makefile.am
+++ b/src/libitm/Makefile.am
@@ -12,7 +12,7 @@ abi_version = -fabi-version=4
config_path = @config_path@
search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) $(top_srcdir)
-libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+libsubincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include
vpath % $(strip $(search_path))
--- a/src/gcc/gcc.cc
+++ b/src/gcc/gcc.cc
@@ -4828,7 +4828,7 @@ process_command (unsigned int decoded_op
GCC_EXEC_PREFIX is typically a directory name with a trailing
/ (which is ignored by make_relative_prefix), so append a
program name. */
- char *tmp_prefix = concat (gcc_exec_prefix, "gcc", NULL);
+ char *tmp_prefix = concat (gcc_exec_prefix, "gcc-cross", NULL);
gcc_libexec_prefix = get_relative_prefix (tmp_prefix,
standard_exec_prefix,
standard_libexec_prefix);
@@ -4854,15 +4854,15 @@ process_command (unsigned int decoded_op
{
int len = strlen (gcc_exec_prefix);
- if (len > (int) sizeof ("/lib/gcc/") - 1
+ if (len > (int) sizeof ("/lib/gcc-cross/") - 1
&& (IS_DIR_SEPARATOR (gcc_exec_prefix[len-1])))
{
- temp = gcc_exec_prefix + len - sizeof ("/lib/gcc/") + 1;
+ temp = gcc_exec_prefix + len - sizeof ("/lib/gcc-cross/") + 1;
if (IS_DIR_SEPARATOR (*temp)
&& filename_ncmp (temp + 1, "lib", 3) == 0
&& IS_DIR_SEPARATOR (temp[4])
- && filename_ncmp (temp + 5, "gcc", 3) == 0)
- len -= sizeof ("/lib/gcc/") - 1;
+ && filename_ncmp (temp + 5, "gcc-cross", 3) == 0)
+ len -= sizeof ("/lib/gcc-cross/") - 1;
}
set_std_prefix (gcc_exec_prefix, len);
--- a/src/gcc/Makefile.in
+++ b/src/gcc/Makefile.in
@@ -635,9 +635,9 @@ libexecdir = @libexecdir@
# --------
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
+libsubdir = $(libdir)/gcc-cross/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
# Directory in which the compiler finds executables
-libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
+libexecsubdir = $(libexecdir)/gcc-cross/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
# Directory in which all plugin resources are installed
plugin_resourcesdir = $(libsubdir)/plugin
# Directory in which plugin headers are installed
@@ -2318,8 +2318,8 @@ default-d.o: config/default-d.cc
DRIVER_DEFINES = \
-DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
- -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
- -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
+ -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-cross/\" \
+ -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc-cross/\" \
-DDEFAULT_TARGET_VERSION=\"$(version)\" \
-DDEFAULT_REAL_TARGET_MACHINE=\"$(real_target_noncanonical)\" \
-DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
@@ -3039,7 +3039,7 @@ PREPROCESSOR_DEFINES = \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-DNATIVE_SYSTEM_HEADER_DIR=\"$(NATIVE_SYSTEM_HEADER_DIR)\" \
-DPREFIX=\"$(prefix)/\" \
- -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
+ -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-cross/\" \
@TARGET_SYSTEM_ROOT_DEFINE@
CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s)
--- a/src/libssp/Makefile.in
+++ b/src/libssp/Makefile.in
@@ -366,7 +366,7 @@ gcc_version := $(shell @get_gcc_base_ver
@LIBSSP_USE_SYMVER_SUN_TRUE@@LIBSSP_USE_SYMVER_TRUE@version_dep = ssp.map-sun
AM_CFLAGS = -Wall $(XCFLAGS)
toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la
-libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
+libsubincludedir = $(libdir)/gcc-cross/$(target_noncanonical)/$(gcc_version)/include
nobase_libsubinclude_HEADERS = ssp/ssp.h ssp/string.h ssp/stdio.h ssp/unistd.h
libssp_la_SOURCES = \
ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \
--- a/src/libssp/Makefile.am
+++ b/src/libssp/Makefile.am
@@ -39,7 +39,7 @@ AM_CFLAGS += $(XCFLAGS)
toolexeclib_LTLIBRARIES = libssp.la libssp_nonshared.la
target_noncanonical = @target_noncanonical@
-libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
+libsubincludedir = $(libdir)/gcc-cross/$(target_noncanonical)/$(gcc_version)/include
nobase_libsubinclude_HEADERS = ssp/ssp.h ssp/string.h ssp/stdio.h ssp/unistd.h
libssp_la_SOURCES = \
--- a/src/libquadmath/Makefile.in
+++ b/src/libquadmath/Makefile.in
@@ -468,7 +468,7 @@ AUTOMAKE_OPTIONS = foreign info-in-build
@BUILD_LIBQUADMATH_TRUE@libquadmath_la_DEPENDENCIES = $(version_dep) $(libquadmath_la_LIBADD)
@BUILD_LIBQUADMATH_TRUE@nodist_libsubinclude_HEADERS = quadmath.h quadmath_weak.h
-@BUILD_LIBQUADMATH_TRUE@libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+@BUILD_LIBQUADMATH_TRUE@libsubincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include
@BUILD_LIBQUADMATH_TRUE@libquadmath_la_SOURCES = \
@BUILD_LIBQUADMATH_TRUE@ math/x2y2m1q.c math/acoshq.c math/fmodq.c \
@BUILD_LIBQUADMATH_TRUE@ math/acosq.c math/frexpq.c \
--- a/src/libquadmath/Makefile.am
+++ b/src/libquadmath/Makefile.am
@@ -41,7 +41,7 @@ libquadmath_la_LDFLAGS = -version-info `
libquadmath_la_DEPENDENCIES = $(version_dep) $(libquadmath_la_LIBADD)
nodist_libsubinclude_HEADERS = quadmath.h quadmath_weak.h
-libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+libsubincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include
libquadmath_la_SOURCES = \
math/x2y2m1q.c math/acoshq.c math/fmodq.c \
--- a/src/libobjc/Makefile.in
+++ b/src/libobjc/Makefile.in
@@ -48,7 +48,7 @@ extra_ldflags_libobjc = @extra_ldflags_l
top_builddir = .
libdir = $(exec_prefix)/lib
-libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_noncanonical)/$(gcc_version)
# Multilib support variables.
MULTISRCTOP =
--- a/src/libada/Makefile.in
+++ b/src/libada/Makefile.in
@@ -70,7 +70,7 @@ GCC_DIR=$(MULTIBUILDTOP)../../$(host_sub
target_noncanonical:=@target_noncanonical@
version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
-libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)
+libsubdir := $(libdir)/gcc-cross/$(target_noncanonical)/$(version)$(MULTISUBDIR)
ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR))
# exeext should not be used because it's the *host* exeext. We're building
--- a/src/libgomp/Makefile.in
+++ b/src/libgomp/Makefile.in
@@ -516,8 +516,8 @@ gcc_version := $(shell @get_gcc_base_ver
search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) $(top_srcdir) \
$(top_srcdir)/../include
-fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude
-libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+fincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude
+libsubincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include
AM_CPPFLAGS = $(addprefix -I, $(search_path))
AM_CFLAGS = $(XCFLAGS)
AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
--- a/src/libgomp/Makefile.am
+++ b/src/libgomp/Makefile.am
@@ -11,8 +11,8 @@ config_path = @config_path@
search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) $(top_srcdir) \
$(top_srcdir)/../include
-fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude
-libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+fincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude
+libsubincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include
vpath % $(strip $(search_path))
--- a/src/libgcc/Makefile.in
+++ b/src/libgcc/Makefile.in
@@ -200,7 +200,7 @@ STRIP = @STRIP@
STRIP_FOR_TARGET = $(STRIP)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(real_host_noncanonical)/$(version)@accel_dir_suffix@
+libsubdir = $(libdir)/gcc-cross/$(real_host_noncanonical)/$(version)@accel_dir_suffix@
# Used to install the shared libgcc.
slibdir = @slibdir@
# Maybe used for DLLs on Windows targets.
--- a/src/libffi/include/Makefile.am
+++ b/src/libffi/include/Makefile.am
@@ -8,6 +8,6 @@ EXTRA_DIST=ffi.h.in
# Where generated headers like ffitarget.h get installed.
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
-toollibffidir := $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+toollibffidir := $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include
toollibffi_HEADERS = ffi.h ffitarget.h
--- a/src/libffi/include/Makefile.in
+++ b/src/libffi/include/Makefile.in
@@ -326,7 +326,7 @@ EXTRA_DIST = ffi.h.in
# Where generated headers like ffitarget.h get installed.
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
-toollibffidir := $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+toollibffidir := $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include
toollibffi_HEADERS = ffi.h ffitarget.h
all: all-am
--- a/src/libcc1/Makefile.am
+++ b/src/libcc1/Makefile.am
@@ -40,7 +40,7 @@ libiberty = $(if $(wildcard $(libiberty_
$(Wc)$(libiberty_normal)))
libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
-plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
+plugindir = $(libdir)/gcc-cross/$(target_noncanonical)/$(gcc_version)/plugin
cc1libdir = $(libdir)/$(libsuffix)
if ENABLE_PLUGIN
--- a/src/libcc1/Makefile.in
+++ b/src/libcc1/Makefile.in
@@ -396,7 +396,7 @@ libiberty = $(if $(wildcard $(libiberty_
$(Wc)$(libiberty_normal)))
libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
-plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
+plugindir = $(libdir)/gcc-cross/$(target_noncanonical)/$(gcc_version)/plugin
cc1libdir = $(libdir)/$(libsuffix)
@ENABLE_PLUGIN_TRUE@plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la
@ENABLE_PLUGIN_TRUE@cc1lib_LTLIBRARIES = libcc1.la
--- a/src/libsanitizer/Makefile.am
+++ b/src/libsanitizer/Makefile.am
@@ -1,6 +1,6 @@
ACLOCAL_AMFLAGS = -I .. -I ../config
-sanincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include/sanitizer
+sanincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include/sanitizer
nodist_saninclude_HEADERS =
--- a/src/libsanitizer/Makefile.in
+++ b/src/libsanitizer/Makefile.in
@@ -361,7 +361,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I .. -I ../config
-sanincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include/sanitizer
+sanincludedir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)/include/sanitizer
nodist_saninclude_HEADERS = $(am__append_1)
@SANITIZER_SUPPORTED_TRUE@SUBDIRS = sanitizer_common $(am__append_2) \
@SANITIZER_SUPPORTED_TRUE@ $(am__append_3) lsan asan ubsan \
--- a/src/libphobos/configure.ac
+++ b/src/libphobos/configure.ac
@@ -256,6 +256,8 @@ AC_SUBST(SPEC_PHOBOS_DEPS)
libtool_VERSION=4:0:0
AC_SUBST(libtool_VERSION)
+# trigger rebuild of the configure file
+
# Set default flags (after DRUNTIME_WERROR!)
if test -z "$GDCFLAGS"; then
GDCFLAGS="-g -O2"
--- a/src/libphobos/m4/druntime.m4
+++ b/src/libphobos/m4/druntime.m4
@@ -114,6 +114,7 @@ AC_DEFUN([DRUNTIME_INSTALL_DIRECTORIES],
# Default case for install directory for D sources files.
gdc_include_dir='$(libdir)/gcc/${target_alias}/${gcc_version}/include/d'
+ gdc_include_dir='${libdir}/gcc-cross/${target_alias}'/${gcc_version}/include/d
AC_SUBST(gdc_include_dir)
])
--- a/src/gcc/ada/gcc-interface/Makefile.in
+++ b/src/gcc/ada/gcc-interface/Makefile.in
@@ -921,7 +921,7 @@ toolexeclibdir = $(ADA_RTL_OBJ_DIR)
ADA_INCLUDE_DIR = $(libsubdir)/adainclude
ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
-ADA_RTL_DSO_DIR = $(toolexeclibdir)
+ADA_RTL_DSO_DIR = $(subst /gcc/,/gcc-cross/,$(toolexeclibdir))
# Special flags
--- a/src/c++tools/Makefile.in
+++ b/src/c++tools/Makefile.in
@@ -21,7 +21,7 @@ bindir := @bindir@
libexecdir := @libexecdir@
target_noncanonical := @target_noncanonical@
gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
-libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
+libexecsubdir := $(libexecdir)/gcc-cross/$(target_noncanonical)/$(gcc_version)
INSTALL := @INSTALL@
INSTALL_PROGRAM := @INSTALL_PROGRAM@
INSTALL_STRIP_PROGRAM := $(srcdir)/../install-sh -c -s
--- a/src/libgm2/libm2cor/Makefile.am
+++ b/src/libgm2/libm2cor/Makefile.am
@@ -27,7 +27,7 @@ MAKEOVERRIDES=
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)
# Used to install the shared libgcc.
slibdir = @slibdir@
--- a/src/libgm2/libm2cor/Makefile.in
+++ b/src/libgm2/libm2cor/Makefile.in
@@ -391,7 +391,7 @@ MAKEOVERRIDES =
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)
MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi)
--- a/src/libgm2/libm2iso/Makefile.am
+++ b/src/libgm2/libm2iso/Makefile.am
@@ -27,7 +27,7 @@ MAKEOVERRIDES=
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)
# Used to install the shared libgcc.
# was slibdir = @slibdir@
slibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)
--- a/src/libgm2/libm2iso/Makefile.in
+++ b/src/libgm2/libm2iso/Makefile.in
@@ -416,7 +416,7 @@ MAKEOVERRIDES =
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)
MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi)
--- a/src/libgm2/libm2log/Makefile.am
+++ b/src/libgm2/libm2log/Makefile.am
@@ -27,7 +27,7 @@ MAKEOVERRIDES=
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)
# Used to install the shared libgcc.
slibdir = @slibdir@
--- a/src/libgm2/libm2log/Makefile.in
+++ b/src/libgm2/libm2log/Makefile.in
@@ -380,7 +380,7 @@ MAKEOVERRIDES =
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)
MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi)
--- a/src/libgm2/libm2min/Makefile.am
+++ b/src/libgm2/libm2min/Makefile.am
@@ -27,7 +27,7 @@ MAKEOVERRIDES=
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)
# Used to install the shared libgcc.
slibdir = @slibdir@
--- a/src/libgm2/libm2min/Makefile.in
+++ b/src/libgm2/libm2min/Makefile.in
@@ -370,7 +370,7 @@ MAKEOVERRIDES =
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)
MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi)
--- a/src/libgm2/libm2pim/Makefile.am
+++ b/src/libgm2/libm2pim/Makefile.am
@@ -27,7 +27,7 @@ MAKEOVERRIDES=
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)
# Used to install the shared libgcc.
slibdir = @slibdir@
--- a/src/libgm2/libm2pim/Makefile.in
+++ b/src/libgm2/libm2pim/Makefile.in
@@ -405,7 +405,7 @@ MAKEOVERRIDES =
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
# Directory in which the compiler finds libraries etc.
-libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
+libsubdir = $(libdir)/gcc-cross/$(target_alias)/$(gcc_version)
MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi)

View File

@@ -0,0 +1,17 @@
# DP: Don't add /usr/local/include for cross compilers. Assume that
# DP: /usr/include is ready for multiarch, but not /usr/local/include.
--- a/src/gcc/cppdefault.cc
+++ b/src/gcc/cppdefault.cc
@@ -66,8 +66,11 @@
#ifdef LOCAL_INCLUDE_DIR
/* /usr/local/include comes before the fixincluded header files. */
{ LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+#if 0
+ /* Unsafe to assume that /usr/local/include is ready for multiarch. */
{ LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
#endif
+#endif
#ifdef PREFIX_INCLUDE_DIR
{ PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 },
#endif

46
debian/patches/cuda-float128.diff vendored Normal file
View File

@@ -0,0 +1,46 @@
# Mask __float128 types from CUDA compilers (LP: #1717257)
--- a/src/libstdc++-v3/include/std/type_traits
+++ b/src/libstdc++-v3/include/std/type_traits
@@ -509,7 +509,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: public true_type { };
#endif
-#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
+#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) && !defined(__CUDACC__)
template<>
struct __is_floating_point_helper<__float128>
: public true_type { };
--- a/src/libstdc++-v3/include/bits/std_abs.h
+++ b/src/libstdc++-v3/include/bits/std_abs.h
@@ -131,7 +131,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __gnu_cxx::__bfloat16_t(__builtin_fabsf(__x)); }
#endif
-#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
+#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) && !defined(__CUDACC__)
__extension__ inline _GLIBCXX_CONSTEXPR
__float128
abs(__float128 __x)
--- a/src/libstdc++-v3/include/bits/stl_algobase.h
+++ b/src/libstdc++-v3/include/bits/stl_algobase.h
@@ -1076,7 +1076,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
__size_to_integer(double __n) { return (long long)__n; }
inline _GLIBCXX_CONSTEXPR long long
__size_to_integer(long double __n) { return (long long)__n; }
-#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
+#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) && !defined(__CUDACC__)
__extension__ inline _GLIBCXX_CONSTEXPR long long
__size_to_integer(__float128 __n) { return (long long)__n; }
#endif
--- a/src/libstdc++-v3/include/std/numbers
+++ b/src/libstdc++-v3/include/std/numbers
@@ -221,7 +221,7 @@ __glibcxx_numbers (_Float128, F128);
__glibcxx_numbers (__gnu_cxx::__bfloat16_t, BF16);
#endif
-#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
+#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) && !defined(__CUDACC__)
__glibcxx_numbers (__float128, Q);
#endif // USE_FLOAT128

17
debian/patches/disable-gdc-tests.diff vendored Normal file
View File

@@ -0,0 +1,17 @@
# DP: Disable D tests, hang on many buildds
--- a/src/gcc/d/Make-lang.in
+++ b/src/gcc/d/Make-lang.in
@@ -206,9 +206,9 @@ d.srcman: doc/gdc.1
# check targets. However, our DejaGNU framework requires 'check-gdc' as its
# entry point. We feed the former to the latter here.
check-d: check-gdc
-lang_checks += check-gdc
-lang_checks_parallelized += check-gdc
-check_gdc_parallelize = 10
+#lang_checks += check-gdc
+#lang_checks_parallelized += check-gdc
+#check_gdc_parallelize = 10
# No D-specific selftests.
selftest-d:

View File

@@ -0,0 +1,14 @@
# DP: Don't turn on DWARF 5 by default, where GCC 11 is not the default.
--- a/src/gcc/doc/invoke.texi
+++ b/src/gcc/doc/invoke.texi
@@ -9630,6 +9630,9 @@ version for most targets is 5 (with the
Darwin/Mac OS X, which default to version 2, and AIX, which defaults
to version 4).
+NOTE: On Ubuntu release, where GCC 11 is not used as the default (21.04
+and earlier releases), it defaults to version 4.
+
Note that with DWARF Version 2, some ports require and always
use some non-conflicting DWARF 3 extensions in the unwind tables.

View File

@@ -0,0 +1,24 @@
# DP: Don't turn on DWARF 5 by default, where GCC 11 is not the default.
--- a/src/gcc/common.opt
+++ b/src/gcc/common.opt
@@ -3353,7 +3353,7 @@ Common Driver JoinedOrMissing RejectNega
Generate debug information in default version of DWARF format.
gdwarf-
-Common Driver Joined UInteger Var(dwarf_version) Init(DWARF_VERSION_DEFAULT) RejectNegative
+Common Driver Joined UInteger Var(dwarf_version) Init(4) RejectNegative
Generate debug information in DWARF v2 (or later) format.
gdwarf32
--- a/src/gcc/defaults.h
+++ b/src/gcc/defaults.h
@@ -1444,7 +1444,7 @@ see the files COPYING3 and COPYING.RUNTI
/* When generating dwarf info, the default standard version we'll honor
and advertise in absence of -gdwarf-<N> on the command line. */
#ifndef DWARF_VERSION_DEFAULT
-#define DWARF_VERSION_DEFAULT 5
+#define DWARF_VERSION_DEFAULT 4
#endif
#ifndef USED_FOR_TARGET

109
debian/patches/g++-multiarch-incdir.diff vendored Normal file
View File

@@ -0,0 +1,109 @@
# DP: Use /usr/include/<multiarch>/c++/4.x as the include directory
# DP: for host dependent c++ header files.
--- a/src/libstdc++-v3/include/Makefile.am
+++ b/src/libstdc++-v3/include/Makefile.am
@@ -1041,7 +1041,7 @@ endif
host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
host_builddir = ./${host_alias}/bits
-host_installdir = ${gxx_include_dir}/${host_alias}$(MULTISUBDIR)/bits
+host_installdir = $(if $(shell $(CC) -print-multiarch),/usr/include/$(shell $(filter-out -m%,$(CC)) -print-multiarch)/c++/$(notdir ${gxx_include_dir})$(MULTISUBDIR)/bits,${gxx_include_dir}/${default_host_alias}$(MULTISUBDIR)/bits)
host_headers = \
${host_srcdir}/ctype_base.h \
${host_srcdir}/ctype_inline.h \
--- a/src/libstdc++-v3/include/Makefile.in
+++ b/src/libstdc++-v3/include/Makefile.in
@@ -1372,7 +1372,7 @@ parallel_headers = \
@GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@c_compatibility_headers_extra = ${c_compatibility_headers}
host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
host_builddir = ./${host_alias}/bits
-host_installdir = ${gxx_include_dir}/${host_alias}$(MULTISUBDIR)/bits
+host_installdir = $(if $(shell $(CC) -print-multiarch),/usr/include/$(shell $(filter-out -m%,$(CC)) -print-multiarch)/c++/$(notdir ${gxx_include_dir})$(MULTISUBDIR)/bits,${gxx_include_dir}/${default_host_alias}$(MULTISUBDIR)/bits)
host_headers = \
${host_srcdir}/ctype_base.h \
${host_srcdir}/ctype_inline.h \
--- a/src/gcc/Makefile.in
+++ b/src/gcc/Makefile.in
@@ -1258,6 +1258,7 @@ FLAGS_TO_PASS = \
"prefix=$(prefix)" \
"local_prefix=$(local_prefix)" \
"gxx_include_dir=$(gcc_gxx_include_dir)" \
+ "gxx_tool_include_dir=$(gcc_gxx_tool_include_dir)" \
"gxx_libcxx_include_dir=$(gcc_gxx_libcxx_include_dir)" \
"build_tooldir=$(build_tooldir)" \
"gcc_tooldir=$(gcc_tooldir)" \
@@ -1959,6 +1960,14 @@ gnat_install_lib = @gnat_install_lib@
# host overrides
-include $(xmake_file)
+# Directory in which the compiler finds target-dependent g++ includes.
+ifneq ($(call if_multiarch,non-empty),)
+ gcc_gxx_tool_include_dir = $(libsubdir)/$(libsubdir_to_prefix)include/$(MULTIARCH_DIRNAME)/c++/$(version)
+else
+ gcc_gxx_tool_include_dir = $(gcc_gxx_include_dir)/$(target_noncanonical)
+endif
+
+
# all-tree.def includes all the tree.def files.
all-tree.def: s-alltree; @true
s-alltree: Makefile
@@ -3179,7 +3188,7 @@ PREPROCESSOR_DEFINES = \
-DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
- -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
+ -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_tool_include_dir)\" \
-DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-DGPLUSPLUS_LIBCXX_INCLUDE_DIR=\"$(gcc_gxx_libcxx_include_dir)\" \
-DGPLUSPLUS_LIBCXX_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_libcxx_include_dir_add_sysroot) \
--- a/src/gcc/cppdefault.cc
+++ b/src/gcc/cppdefault.cc
@@ -49,6 +49,8 @@ const struct default_include cpp_include
/* Pick up GNU C++ target-dependent include files. */
{ GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1,
GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 },
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1,
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 2 },
#endif
#ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
/* Pick up GNU C++ backward and deprecated include files. */
--- a/src/gcc/incpath.cc
+++ b/src/gcc/incpath.cc
@@ -164,6 +164,18 @@ add_standard_paths (const char *sysroot,
}
str = reconcat (str, str, dir_separator_str,
imultiarch, NULL);
+ if (p->cplusplus && strstr (str, "/c++/"))
+ {
+ char *suffix = strstr (str, "/c++/");
+ *suffix++ = '\0';
+ suffix = xstrdup (suffix);
+ str = reconcat (str, str, dir_separator_str,
+ imultiarch,
+ dir_separator_str, suffix, NULL);
+ }
+ else
+ str = reconcat (str, str, dir_separator_str,
+ imultiarch, NULL);
}
add_path (str, INC_SYSTEM, p->cxx_aware, false);
}
@@ -229,7 +241,16 @@ add_standard_paths (const char *sysroot,
free (str);
continue;
}
- str = reconcat (str, str, dir_separator_str, imultiarch, NULL);
+ if (p->cplusplus && strstr (str, "/c++/"))
+ {
+ char *suffix = strstr (str, "/c++/");
+ *suffix++ = '\0';
+ suffix = xstrdup (suffix);
+ str = reconcat (str, str, dir_separator_str, imultiarch,
+ dir_separator_str, suffix, NULL);
+ }
+ else
+ str = reconcat (str, str, dir_separator_str, imultiarch, NULL);
}
add_path (str, INC_SYSTEM, p->cxx_aware, false);

View File

@@ -0,0 +1,44 @@
# DP: Don't run some tests from the guality test suite on armhf. These fail
# DP: on every target, but seem to hang on the buildds occasionally on armhf.
--- a/src/gcc/testsuite/gcc.dg/guality/guality.exp
+++ b/src/gcc/testsuite/gcc.dg/guality/guality.exp
@@ -93,7 +93,37 @@ if {[check_guality "
}
}
- gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] "" ""
+ # FIXME: these seem to hang on the buildds, and gdb always times out
+ # trying to run them.
+ if { [istarget arm-*-linux-gnueabi*] } {
+ set guality [list]
+ foreach file [lsort [glob $srcdir/$subdir/*.c]] {
+ switch -glob -- [file tail $file] {
+ pr36728-*.c -
+ pr41616-1.c -
+ pr43051-1.c -
+ pr54200.c -
+ pr54519-*.c -
+ pr54551.c -
+ pr54693-2.c -
+ pr54796.c -
+ pr56154-1.c -
+ pr58791-3.c -
+ pr58791-5.c -
+ pr68860-1.c -
+ pr68860-2.c -
+ pr78726.c -
+ pr89528.c -
+ pr90074.c -
+ pr90716.c { }
+ * { lappend guality $file }
+ }
+ }
+ } {
+ set guality [lsort [glob $srcdir/$subdir/*.c]]
+ }
+
+ gcc-dg-runtest $guality "" ""
gcc-dg-runtest $general "" "-Wc++-compat"
set-torture-options \
[list "-O0" "-Og"] \

85
debian/patches/gcc-as-needed-gold.diff vendored Normal file
View File

@@ -0,0 +1,85 @@
# DP: Use --push-state/--pop-state for gold as well when linking libtsan.
--- a/src/gcc/gcc.cc
+++ b/src/gcc/gcc.cc
@@ -777,10 +777,10 @@ proper position among the other output f
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
- " %{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+ " %{!static-libasan:--push-state --no-as-needed}" \
" -lasan " \
" %{static-libasan:" LD_DYNAMIC_OPTION "}" \
- " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ " %{!static-libasan:--pop-state}" \
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -816,10 +816,10 @@ proper position among the other output f
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
- " %{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+ " %{!static-libtsan:--push-state --no-as-needed}" \
" -ltsan " \
" %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
- " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ " %{!static-libtsan:--pop-state}" \
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -837,10 +837,10 @@ proper position among the other output f
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
- " %{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+ " %{!static-liblsan:--push-state --no-as-needed}" \
" -llsan " \
" %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
- " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ " %{!static-liblsan:--pop-state}" \
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -856,10 +856,10 @@ proper position among the other output f
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
- " %{!static-libubsan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+ " %{!static-libubsan:--push-state --no-as-needed}" \
" -lubsan " \
" %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
- " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
+ " %{!static-libubsan:--pop-state}" \
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--- a/src/gcc/config/gnu-user.h
+++ b/src/gcc/config/gnu-user.h
@@ -136,22 +136,22 @@ see the files COPYING3 and COPYING.RUNTI
#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
"%{static-libasan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:--push-state --no-as-needed -lasan --pop-state}"
#undef LIBHWASAN_EARLY_SPEC
#define LIBHWASAN_EARLY_SPEC "%{!shared:libhwasan_preinit%O%s} " \
"%{static-libhwasan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-libhwasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lhwasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
+ LD_DYNAMIC_OPTION "}}%{!static-libhwasan:--push-state --no-as-needed -lhwasan --pop-state}"
#undef LIBTSAN_EARLY_SPEC
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
"%{static-libtsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:--push-state --no-as-needed -ltsan --pop-state}"
#undef LIBLSAN_EARLY_SPEC
#define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \
"%{static-liblsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
+ LD_DYNAMIC_OPTION "}}%{!static-liblsan:--push-state --no-as-needed -llsan --pop-state}"
#endif
#undef TARGET_F951_OPTIONS

284
debian/patches/gcc-as-needed.diff vendored Normal file
View File

@@ -0,0 +1,284 @@
# DP: On linux targets pass --as-needed by default to the linker, but always
# DP: link the sanitizer libraries with --no-as-needed.
--- a/src/gcc/gcc.cc
+++ b/src/gcc/gcc.cc
@@ -776,8 +776,11 @@ proper position among the other output f
#ifdef LIBASAN_EARLY_SPEC
#define LIBASAN_SPEC STATIC_LIBASAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \
- "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}" \
+#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
+ " %{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+ " -lasan " \
+ " %{static-libasan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBASAN_LIBS
#else
#define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -812,8 +815,11 @@ proper position among the other output f
#ifdef LIBTSAN_EARLY_SPEC
#define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \
- "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
+ " %{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+ " -ltsan " \
+ " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBTSAN_LIBS
#else
#define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -830,8 +836,11 @@ proper position among the other output f
#ifdef LIBLSAN_EARLY_SPEC
#define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
#elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION \
- "} -llsan %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
+ " %{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+ " -llsan " \
+ " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBLSAN_LIBS
#else
#define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -846,8 +855,11 @@ proper position among the other output f
#define STATIC_LIBUBSAN_LIBS \
" %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
#ifdef HAVE_LD_STATIC_DYNAMIC
-#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION \
- "} -lubsan %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
+ " %{!static-libubsan:%{!fuse-ld=gold:--push-state} --no-as-needed}" \
+ " -lubsan " \
+ " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
+ " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
STATIC_LIBUBSAN_LIBS
#else
#define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--- a/src/gcc/config/gnu-user.h
+++ b/src/gcc/config/gnu-user.h
@@ -136,22 +136,22 @@ see the files COPYING3 and COPYING.RUNTI
#define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
"%{static-libasan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
+ LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#undef LIBHWASAN_EARLY_SPEC
#define LIBHWASAN_EARLY_SPEC "%{!shared:libhwasan_preinit%O%s} " \
"%{static-libhwasan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-libhwasan:-lhwasan}"
+ LD_DYNAMIC_OPTION "}}%{!static-libhwasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lhwasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#undef LIBTSAN_EARLY_SPEC
#define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
"%{static-libtsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
+ LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#undef LIBLSAN_EARLY_SPEC
#define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \
"%{static-liblsan:%{!shared:" \
LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \
- LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}"
+ LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
#endif
#undef TARGET_F951_OPTIONS
--- a/src/gcc/config/aarch64/aarch64-linux.h
+++ b/src/gcc/config/aarch64/aarch64-linux.h
@@ -36,6 +36,7 @@
#define LINUX_TARGET_LINK_SPEC "%{h*} \
--hash-style=gnu \
+ %{!fsanitize=*:--as-needed} \
%{static:-Bstatic} \
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
--- a/src/gcc/config/ia64/linux.h
+++ b/src/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
#undef LINK_SPEC
-#define LINK_SPEC " --hash-style=gnu \
+#define LINK_SPEC " --hash-style=gnu %{!fsanitize=*:--as-needed} \
%{shared:-shared} \
%{!shared: \
%{!static: \
--- a/src/gcc/config/sparc/linux.h
+++ b/src/gcc/config/sparc/linux.h
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
#undef LINK_SPEC
-#define LINK_SPEC "-m elf32_sparc --hash-style=gnu %{shared:-shared} \
+#define LINK_SPEC "-m elf32_sparc --hash-style=gnu %{!fsanitize=*:--as-needed} %{shared:-shared} \
%{!mno-relax:%{!r:-relax}} \
%{!shared: \
%{!static: \
--- a/src/gcc/config/s390/linux.h
+++ b/src/gcc/config/s390/linux.h
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3.
#undef LINK_SPEC
#define LINK_SPEC \
- "%{m31:-m elf_s390}%{m64:-m elf64_s390} --hash-style=gnu \
+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --hash-style=gnu %{!fsanitize=*:--as-needed} \
%{shared:-shared} \
%{!shared: \
%{static:-static} \
--- a/src/gcc/config/rs6000/linux64.h
+++ b/src/gcc/config/rs6000/linux64.h
@@ -378,13 +378,13 @@ extern int dot_symbols;
" -m elf64ppc")
#endif
-#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " --hash-style=gnu %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " --hash-style=gnu %{!fsanitize=*:--as-needed} %{!shared: %{!static: \
%{!static-pie: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}} \
%(link_os_extra_spec32)"
-#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " --hash-style=gnu %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " --hash-style=gnu %{!fsanitize=*:--as-needed} %{!shared: %{!static: \
%{!static-pie: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
--- a/src/gcc/config/rs6000/sysv4.h
+++ b/src/gcc/config/rs6000/sysv4.h
@@ -781,7 +781,7 @@ GNU_USER_TARGET_CC1_SPEC
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#endif
-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --hash-style=gnu %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --hash-style=gnu %{!fsanitize=*:--as-needed} %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
--- a/src/gcc/config/i386/gnu-user64.h
+++ b/src/gcc/config/i386/gnu-user64.h
@@ -57,6 +57,7 @@ see the files COPYING3 and COPYING.RUNTI
%{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
%{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
--hash-style=gnu \
+ %{!fsanitize=*:--as-needed} \
%{shared:-shared} \
%{!shared: \
%{!static: \
--- a/src/gcc/config/i386/gnu-user.h
+++ b/src/gcc/config/i386/gnu-user.h
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3.
{ "link_emulation", GNU_USER_LINK_EMULATION },\
{ "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
-#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --hash-style=gnu %{shared:-shared} \
+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --hash-style=gnu %{!fsanitize=*:--as-needed} %{shared:-shared} \
%{!shared: \
%{!static: \
%{!static-pie: \
--- a/src/gcc/config/alpha/linux-elf.h
+++ b/src/gcc/config/alpha/linux-elf.h
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3.
#define ELF_DYNAMIC_LINKER GNU_USER_DYNAMIC_LINKER
-#define LINK_SPEC "-m elf64alpha --hash-style=gnu %{G*} %{relax:-relax} \
+#define LINK_SPEC "-m elf64alpha --hash-style=gnu %{!fsanitize=*:--as-needed} %{G*} %{relax:-relax} \
%{O*:-O3} %{!O*:-O1} \
%{shared:-shared} \
%{!shared: \
--- a/src/gcc/config/arm/linux-elf.h
+++ b/src/gcc/config/arm/linux-elf.h
@@ -71,6 +71,7 @@
%{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
-X \
--hash-style=gnu \
+ %{!fsanitize=*:--as-needed} \
%{mbig-endian:-EB} %{mlittle-endian:-EL}" \
SUBTARGET_EXTRA_LINK_SPEC
--- a/src/gcc/config/mips/gnu-user.h
+++ b/src/gcc/config/mips/gnu-user.h
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3.
#undef GNU_USER_TARGET_LINK_SPEC
#define GNU_USER_TARGET_LINK_SPEC "\
%{G*} %{EB} %{EL} %{mips*} %{shared} \
+ %{!fsanitize=*:--as-needed} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
--- a/src/gcc/config/riscv/linux.h
+++ b/src/gcc/config/riscv/linux.h
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3.
#define LINK_SPEC "\
-hash-style=gnu \
+%{!fsanitize=*:--as-needed} \
-melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \
%{mno-relax:--no-relax} \
-X \
--- a/src/gcc/config/m68k/linux.h
+++ b/src/gcc/config/m68k/linux.h
@@ -78,6 +78,7 @@ along with GCC; see the file COPYING3.
#undef LINK_SPEC
#define LINK_SPEC "-m m68kelf %{shared} \
+ %{!fsanitize=*:--as-needed} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
--- a/src/gcc/config/sh/linux.h
+++ b/src/gcc/config/sh/linux.h
@@ -72,6 +72,7 @@ along with GCC; see the file COPYING3.
#undef SUBTARGET_LINK_SPEC
#define SUBTARGET_LINK_SPEC \
"%{shared:-shared} \
+ %{!fsanitize=*:--as-needed} \
%{!static: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
--- a/src/gcc/config/pa/pa-linux.h
+++ b/src/gcc/config/pa/pa-linux.h
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3.
#undef LINK_SPEC
#define LINK_SPEC "\
+ %{!fsanitize=*:--as-needed} \
%{shared:-shared} \
%{!shared: \
%{!static: \
--- a/src/gcc/config/loongarch/gnu-user.h
+++ b/src/gcc/config/loongarch/gnu-user.h
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.
#undef GNU_USER_TARGET_LINK_SPEC
#define GNU_USER_TARGET_LINK_SPEC \
"%{G*} %{shared} -m " GNU_USER_LINK_EMULATION \
+ " %{!fsanitize=*:--as-needed} " \
"%{!shared: %{static} " \
"%{!static: %{!static-pie: %{rdynamic:-export-dynamic} " \
"-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} " \
--- a/src/gcc/config/sparc/linux64.h
+++ b/src/gcc/config/sparc/linux64.h
@@ -90,7 +90,7 @@ along with GCC; see the file COPYING3.
{ "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
{ "link_arch", LINK_ARCH_SPEC },
-#define LINK_ARCH32_SPEC "-m elf32_sparc %{shared:-shared} \
+#define LINK_ARCH32_SPEC "-m elf32_sparc %{shared:-shared} %{!fsanitize=*:--as-needed} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
@@ -98,7 +98,7 @@ along with GCC; see the file COPYING3.
%{static:-static}} \
"
-#define LINK_ARCH64_SPEC "-m elf64_sparc %{shared:-shared} \
+#define LINK_ARCH64_SPEC "-m elf64_sparc %{shared:-shared} %{!fsanitize=*:--as-needed} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \

13
debian/patches/gcc-auto-build.diff vendored Normal file
View File

@@ -0,0 +1,13 @@
# DP: Fix cross building a native compiler.
--- a/src/gcc/configure.ac
+++ b/src/gcc/configure.ac
@@ -2163,7 +2163,7 @@ else
# Clearing GMPINC is necessary to prevent host headers being
# used by the build compiler. Defining GENERATOR_FILE stops
# system.h from including gmp.h.
- CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+ CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD} -DGENERATOR_FILE" \
CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \

View File

@@ -0,0 +1,78 @@
# DP: Document distro specific compiler flags turned on by default
--- a/src/gcc/doc/invoke.texi
+++ b/src/gcc/doc/invoke.texi
@@ -12487,6 +12487,19 @@ also turns on the following optimization
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
+NOTE: In Ubuntu 8.10 and later versions, @option{-D_FORTIFY_SOURCE=2},
+in Ubuntu 24.04 and later versions, @option{-D_FORTIFY_SOURCE=3}, is
+set by default, and is activated when @option{-O} is set to 2 or higher.
+This enables additional compile-time and run-time checks for several libc
+functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
+NOTE: In Debian 13 and Ubuntu 24.04 and later versions,
+@option{-D_TIME_BITS=64} together with @option{-D_FILE_OFFSET_BITS=64} is
+set by default on the 32bit architectures @samp{armel}, @samp{armhf},
+@samp{hppa}, @samp{m68k}, @samp{mips}, @samp{mipsel}, @samp{powerpc} and
+@samp{sh4}.
+
@opindex O3
@item -O3
Optimize yet more. @option{-O3} turns on all optimizations specified
@@ -16109,6 +16122,9 @@ value of a shared integer constant.
The minimum size of buffers (i.e.@: arrays) that receive stack smashing
protection when @option{-fstack-protector} is used.
+This default before Ubuntu 10.10 was "8". Currently it is "4", to increase
+the number of functions protected by the stack protector.
+
@item min-size-for-stack-sharing
The minimum size of variables taking part in stack slot sharing when not
optimizing.
@@ -17931,6 +17947,10 @@ Currently the x86 GNU/Linux target provi
on Intel Control-flow Enforcement Technology (CET) which works for
i686 processor or newer.
+NOTE: In Ubuntu 19.10 and later versions, @option{-fcf-protection}
+is enabled by default for C, C++, ObjC, ObjC++, if none of
+@option{-fno-cf-protection} nor @option{-fcf-protection=*} are found.
+
@opindex fharden-compares
@item -fharden-compares
For every logical test that survives gimple optimizations and is
@@ -18086,6 +18106,11 @@ references to local frame addresses. On
allocated on the stack are considered, optimized away variables or variables
allocated in registers don't count.
+NOTE: In Ubuntu 14.10 and later versions,
+@option{-fstack-protector-strong} is enabled by default for C,
+C++, ObjC, ObjC++, if none of @option{-fno-stack-protector},
+@option{-nostdlib}, nor @option{-ffreestanding} are found.
+
@opindex fstack-protector-explicit
@item -fstack-protector-explicit
Like @option{-fstack-protector} but only protects those functions which
@@ -18149,6 +18174,10 @@ allocations. @option{-fstack-clash-prot
protection for static stack allocations if the target supports
@option{-fstack-check=specific}.
+NOTE: In Ubuntu 19.10 and later versions,
+@option{-fstack-clash-protection} is enabled by default for C,
+C++, ObjC, ObjC++, unless @option{-fno-stack-clash-protection} is found.
+
@opindex fstack-limit-register
@opindex fstack-limit-symbol
@opindex fno-stack-limit
@@ -18926,6 +18955,9 @@ For example, @option{-Wl,-Map,output.map
linker. When using the GNU linker, you can also get the same effect with
@option{-Wl,-Map=output.map}.
+NOTE: In Ubuntu 8.10 and later versions, for LDFLAGS, the option
+@option{-Wl,-z,relro} is used. To disable, use @option{-Wl,-z,norelro}.
+
@opindex u
@item -u @var{symbol}
Pretend the symbol @var{symbol} is undefined, to force linking of

321
debian/patches/gcc-distro-specs.diff vendored Normal file
View File

@@ -0,0 +1,321 @@
# DP: Add empty distro and hardening specs
--- a/src/gcc/gcc.cc
+++ b/src/gcc/gcc.cc
@@ -27,6 +27,11 @@ CC recognizes how to compile each input
Once it knows which kind of compilation to perform, the procedure for
compilation is specified by a string called a "spec". */
+/* Inject some default compilation flags which are used as the default.
+ Done by the packaging build system. Should that be done in the headers
+ gcc/config/<arch>/*.h instead? */
+#include "distro-defaults.h"
+
#define INCLUDE_STRING
#include "config.h"
#include "system.h"
@@ -988,6 +993,113 @@ proper position among the other output f
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
#endif
+/* Generate full unwind information covering all program points.
+ Only needed for some architectures. */
+#ifndef ASYNC_UNWIND_SPEC
+# ifdef DIST_DEFAULT_ASYNC_UNWIND
+# define ASYNC_UNWIND_SPEC "%{!fno-asynchronous-unwind-tables:-fasynchronous-unwind-tables}"
+# else
+# define ASYNC_UNWIND_SPEC ""
+# endif
+#endif
+
+/* Turn on stack protector.
+ */
+#ifndef SSP_DEFAULT_SPEC
+# ifdef DIST_DEFAULT_SSP
+# ifdef DIST_DEFAULT_SSP_STRONG
+# define SSP_DEFAULT_SPEC " %{!fno-stack-protector:%{!fstack-protector-explicit:%{!fstack-protector-all:%{!ffreestanding:%{!nostdlib:%{!fstack-protector:-fstack-protector-strong}}}}}}"
+# else
+# define SSP_DEFAULT_SPEC " %{!fno-stack-protector:%{!fstack-protector-explicit:%{!fstack-protector-all:%{!ffreestanding:%{!nostdlib:-fstack-protector}}}}}"
+# endif
+# else
+# define SSP_DEFAULT_SPEC ""
+# endif
+#endif
+
+/* Turn on -Wformat -Wformat-security by default for C, C++,
+ ObjC, ObjC++. */
+#ifndef FORMAT_SECURITY_SPEC
+# ifdef DIST_DEFAULT_FORMAT_SECURITY
+# define FORMAT_SECURITY_SPEC " %{!Wformat:%{!Wformat=2:%{!Wformat=0:%{!Wall:-Wformat} %{!Wno-format-security:-Wformat-security}}}}"
+# else
+# define FORMAT_SECURITY_SPEC ""
+# endif
+#endif
+
+/* Enable -fstack-clash-protection by default. Only available
+ on some targets. */
+#ifndef STACK_CLASH_SPEC
+# ifdef DIST_DEFAULT_STACK_CLASH
+# define STACK_CLASH_SPEC " %{!fno-stack-clash-protection:-fstack-clash-protection}"
+# else
+# define STACK_CLASH_SPEC ""
+# endif
+#endif
+
+/* Enable code instrumentation of control-flow transfers.
+ Available on x86 and x86_64. */
+#ifndef CF_PROTECTION_SPEC
+# ifdef DIST_DEFAULT_CF_PROTECTION
+# define CF_PROTECTION_SPEC " %{!m16:%{!m32:%{!fcf-protection*:%{!fno-cf-protection:-fcf-protection}}}}"
+# else
+# define CF_PROTECTION_SPEC ""
+# endif
+#endif
+
+/* Enable -D_TIME_BITS=64, only available on some 32bit targets. */
+#ifndef TIMET64_SPEC
+# ifdef DIST_DEFAULT_TIMET64
+# define TIMET64_SPEC " %{!m16:%{!m64:%{!D_DISTRO_EVADE_TIME_BITS:%{!D_TIME_BITS=*:%{!U_TIME_BITS:-D_TIME_BITS=64%{!D_FILE_OFFSET_BITS=*:%{!U_FILE_OFFSET_BITS: -D_FILE_OFFSET_BITS=64}}}}}}}"
+# else
+# define TIMET64_SPEC ""
+# endif
+#endif
+
+/* Enable -D_FORTIFY_SOURCE= */
+#ifndef FORTIFY_SOURCE_SPEC
+# ifdef DIST_DEFAULT_FORTIFY_SOURCE
+# define FORTIFY_SOURCE_SPEC " %{!O0:%{O*:%{!D_FORTIFY_SOURCE=*:%{!U_FORTIFY_SOURCE:-D_FORTIFY_SOURCE=" DIST_DEFAULT_FORTIFY_SOURCE_S "}}}}"
+# else
+# define FORTIFY_SOURCE_SPEC ""
+# endif
+#endif
+
+#ifndef BIND_NOW_SPEC
+# if defined(DIST_DEFAULT_BIND_NOW) && !defined(ACCEL_COMPILER)
+# define BIND_NOW_SPEC " -z now"
+# else
+# define BIND_NOW_SPEC ""
+# endif
+#endif
+
+#ifndef RELRO_SPEC
+# ifdef DIST_DEFAULT_RELRO
+# define RELRO_SPEC " -z relro "
+# else
+# define RELRO_SPEC ""
+# endif
+#endif
+
+/* Don't enable any of those for the offload compilers,
+ unsupported. */
+#if !defined(DISTRO_DEFAULT_CPP_SPEC) && !defined(ACCEL_COMPILER)
+# define DISTRO_DEFAULT_CPP_SPEC TIMET64_SPEC FORTIFY_SOURCE_SPEC
+#else
+# define DISTRO_DEFAULT_CPP_SPEC ""
+#endif
+#if !defined(DISTRO_DEFAULT_SPEC) && !defined(ACCEL_COMPILER)
+# define DISTRO_DEFAULT_SPEC ASYNC_UNWIND_SPEC SSP_DEFAULT_SPEC \
+ FORMAT_SECURITY_SPEC STACK_CLASH_SPEC CF_PROTECTION_SPEC
+#else
+# define DISTRO_DEFAULT_SPEC ""
+#endif
+#if !defined(DISTRO_DEFAULT_LINK_SPEC) && !defined(ACCEL_COMPILER)
+# define DISTRO_DEFAULT_LINK_SPEC RELRO_SPEC
+#else
+# define DISTRO_DEFAULT_LINK_SPEC ""
+#endif
+
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1044,7 +1156,7 @@ proper position among the other output f
#ifndef LINK_PIE_SPEC
#ifdef HAVE_LD_PIE
#ifndef LD_PIE_SPEC
-#define LD_PIE_SPEC "-pie"
+#define LD_PIE_SPEC "-pie" BIND_NOW_SPEC
#endif
#else
#define LD_PIE_SPEC ""
@@ -1161,6 +1273,7 @@ proper position among the other output f
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
+ DISTRO_DEFAULT_LINK_SPEC \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \
@@ -1205,6 +1318,8 @@ static const char *cpp_spec = CPP_SPEC;
static const char *cc1_spec = CC1_SPEC OS_CC1_SPEC;
static const char *cc1plus_spec = CC1PLUS_SPEC;
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
+static const char *distro_default_cpp_spec = DISTRO_DEFAULT_CPP_SPEC;
+static const char *distro_default_spec = DISTRO_DEFAULT_SPEC;
static const char *link_ssp_spec = LINK_SSP_SPEC;
static const char *asm_spec = ASM_SPEC;
static const char *asm_final_spec = ASM_FINAL_SPEC;
@@ -1265,7 +1380,7 @@ static const char *cpp_options =
"%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
%{f*} %{g*:%{%:debug-level-gt(0):%{g*}\
%{!fno-working-directory:-fworking-directory}}} %{O*}\
- %{undef} %{save-temps*:-fpch-preprocess}";
+ %{undef} %{save-temps*:-fpch-preprocess} %(distro_defaults_cpp) %(distro_defaults)";
/* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al.
@@ -1459,9 +1574,9 @@ static const struct compiler default_com
%{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\
cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \
- %(cc1_options)}\
+ %(cc1_options) %(distro_defaults_cpp) %(distro_defaults)}\
%{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\
- cc1 %(cpp_unique_options) %(cc1_options)}}}\
+ cc1 %(cpp_unique_options) %(distro_defaults_cpp) %(cc1_options) %(distro_defaults)}}}\
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 1},
{"-",
"%{!E:%e-E or -x required when input is from standard input}\
@@ -1475,18 +1590,18 @@ static const struct compiler default_com
%{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\
cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \
- %(cc1_options)\
+ %(cc1_options) %(distro_defaults_cpp) %(distro_defaults)\
%{!fsyntax-only:%{!S:-o %g.s} \
%{!fdump-ada-spec*:%{!o*:--output-pch %w%i.gch}\
%W{o*:--output-pch %w%*}}%{!S:%V}}}\
%{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\
- cc1 %(cpp_unique_options) %(cc1_options)\
+ cc1 %(cpp_unique_options) %(distro_defaults_cpp) %(cc1_options) %(distro_defaults)\
%{!fsyntax-only:%{!S:-o %g.s} \
%{!fdump-ada-spec*:%{!o*:--output-pch %w%i.gch}\
%W{o*:--output-pch %w%*}}%{!S:%V}}}}}}}}", 0, 0, 0},
{".i", "@cpp-output", 0, 0, 0},
{"@cpp-output",
- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
{".s", "@assembler", 0, 0, 0},
{"@assembler",
"%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
@@ -1718,6 +1833,8 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("cc1_options", &cc1_options),
INIT_STATIC_SPEC ("cc1plus", &cc1plus_spec),
INIT_STATIC_SPEC ("link_gcc_c_sequence", &link_gcc_c_sequence_spec),
+ INIT_STATIC_SPEC ("distro_defaults", &distro_default_spec),
+ INIT_STATIC_SPEC ("distro_defaults_cpp", &distro_default_cpp_spec),
INIT_STATIC_SPEC ("link_ssp", &link_ssp_spec),
INIT_STATIC_SPEC ("endfile", &endfile_spec),
INIT_STATIC_SPEC ("link", &link_spec),
--- a/src/gcc/cp/lang-specs.h
+++ b/src/gcc/cp/lang-specs.h
@@ -51,7 +51,7 @@ along with GCC; see the file COPYING3.
" %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}"
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
" %{fmodules-ts:-fmodule-header %{fpreprocessed:-fdirectives-only}}"
- " %(cc1_options) %2"
+ " %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %2"
" %{!fsyntax-only:"
" %{!S:-o %g.s}"
" %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
@@ -72,7 +72,7 @@ along with GCC; see the file COPYING3.
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
" %{fmodules-ts:-fmodule-header=system"
" %{fpreprocessed:-fdirectives-only}}"
- " %(cc1_options) %2"
+ " %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %2"
" %{!fsyntax-only:"
" %{!S:-o %g.s}"
" %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
@@ -92,7 +92,7 @@ along with GCC; see the file COPYING3.
" %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}"
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
" %{fmodules-ts:-fmodule-header=user %{fpreprocessed:-fdirectives-only}}"
- " %(cc1_options) %2"
+ " %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %2"
" %{!fsyntax-only:"
" %{!S:-o %g.s}"
" %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
@@ -107,7 +107,7 @@ along with GCC; see the file COPYING3.
" cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed"
" %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}"
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
- " %(cc1_options) %2"
+ " %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %2"
" %{!fsyntax-only:"
" %{fmodule-only:%{!S:-o %g.s%V}}"
" %{!fmodule-only:%(invoke_as)}}"
@@ -116,7 +116,7 @@ along with GCC; see the file COPYING3.
{".ii", "@c++-cpp-output", 0, 0, 0},
{"@c++-cpp-output",
"%{!E:%{!M:%{!MM:"
- " cc1plus -fpreprocessed %i %(cc1_options) %2"
+ " cc1plus -fpreprocessed %i %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %2"
" %{!fsyntax-only:"
" %{fmodule-only:%{!S:-o %g.s%V}}"
" %{!fmodule-only:%{!fmodule-header*:%(invoke_as)}}}"
--- a/src/gcc/objc/lang-specs.h
+++ b/src/gcc/objc/lang-specs.h
@@ -29,9 +29,9 @@ along with GCC; see the file COPYING3.
%{traditional|traditional-cpp:\
%eGNU Objective C no longer supports traditional compilation}\
%{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\
- cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\
+ cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %{print-objc-runtime-info} %{gen-decls}}\
%{!save-temps*:%{!no-integrated-cpp:\
- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\
+ cc1obj %(cpp_unique_options) %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %{print-objc-runtime-info} %{gen-decls}}}\
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
{"@objective-c-header",
"%{E|M|MM:cc1obj -E %{traditional|traditional-cpp:-traditional-cpp}\
@@ -40,7 +40,7 @@ along with GCC; see the file COPYING3.
%{traditional|traditional-cpp:\
%eGNU Objective C no longer supports traditional compilation}\
%{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\
- cc1obj -fpreprocessed %b.mi %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
+ cc1obj -fpreprocessed %b.mi %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %{print-objc-runtime-info} %{gen-decls}\
-o %g.s %{!o*:--output-pch %i.gch}\
%W{o*:--output-pch %*}%V}\
%{!save-temps*:%{!no-integrated-cpp:\
@@ -49,9 +49,9 @@ along with GCC; see the file COPYING3.
%W{o*:--output-pch %*}%V}}}}}", 0, 0, 0},
{".mi", "@objective-c-cpp-output", 0, 0, 0},
{"@objective-c-cpp-output",
- "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
+ "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %{print-objc-runtime-info} %{gen-decls}\
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
{"@objc-cpp-output",
"%nobjc-cpp-output is deprecated; please use objective-c-cpp-output instead\n\
- %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\
+ %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %{print-objc-runtime-info} %{gen-decls}\
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
--- a/src/gcc/objcp/lang-specs.h
+++ b/src/gcc/objcp/lang-specs.h
@@ -36,7 +36,7 @@ along with GCC; see the file COPYING3.
%(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\
cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
- %(cc1_options) %2\
+ %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %2\
-o %g.s %{!o*:--output-pch %i.gch} %W{o*:--output-pch %*}%V}}}",
CPLUSPLUS_CPP_SPEC, 0, 0},
{"@objective-c++",
@@ -46,16 +46,16 @@ along with GCC; see the file COPYING3.
%(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\
cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
- %(cc1_options) %2\
+ %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %2\
%{!fsyntax-only:%(invoke_as)}}}}",
CPLUSPLUS_CPP_SPEC, 0, 0},
{".mii", "@objective-c++-cpp-output", 0, 0, 0},
{"@objective-c++-cpp-output",
"%{!M:%{!MM:%{!E:\
- cc1objplus -fpreprocessed %i %(cc1_options) %2\
+ cc1objplus -fpreprocessed %i %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %2\
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
{"@objc++-cpp-output",
"%nobjc++-cpp-output is deprecated; please use objective-c++-cpp-output instead\n\
%{!M:%{!MM:%{!E:\
- cc1objplus -fpreprocessed %i %(cc1_options) %2\
+ cc1objplus -fpreprocessed %i %(distro_defaults_cpp) %(cc1_options) %(distro_defaults) %2\
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},

View File

@@ -0,0 +1,20 @@
# DP: Add options and specs for languages that are not built from a source
# DP: (but built from separate sources).
---
gcc/Makefile.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
--- a/src/gcc/Makefile.in
+++ b/src/gcc/Makefile.in
@@ -620,8 +620,8 @@ xm_include_list=@xm_include_list@
xm_defines=@xm_defines@
lang_checks=
lang_checks_parallelized=
-lang_opt_files=@lang_opt_files@ $(srcdir)/c-family/c.opt $(srcdir)/common.opt $(srcdir)/params.opt $(srcdir)/analyzer/analyzer.opt
-lang_specs_files=@lang_specs_files@
+lang_opt_files=@lang_opt_files@ $(srcdir)/c-family/c.opt $(srcdir)/common.opt $(srcdir)/params.opt $(srcdir)/analyzer/analyzer.opt $(foreach lang,$(subst ada,ada/gcc-interface,$(debian_extra_langs)),$(srcdir)/$(lang)/lang.opt)
+lang_specs_files=@lang_specs_files@ $(foreach lang,$(subst ada,ada/gcc-interface,$(debian_extra_langs)),$(srcdir)/$(lang)/lang-specs.h)
lang_tree_files=@lang_tree_files@
target_cpu_default=@target_cpu_default@
OBJC_BOEHM_GC=@objc_boehm_gc@

120
debian/patches/gcc-foffload-default.diff vendored Normal file
View File

@@ -0,0 +1,120 @@
# DP: Allow setting offload targets by OFFLOAD_TARGET_DEFAULT
https://src.fedoraproject.org/rpms/gcc/raw/rawhide/f/gcc11-foffload-default.patch
2019-01-17 Jakub Jelinek <jakub@redhat.com>
* gcc.c (offload_targets_default): New variable.
(process_command): Set it if -foffload is defaulted.
(driver::maybe_putenv_OFFLOAD_TARGETS): Add OFFLOAD_TARGET_DEFAULT=1
into environment if -foffload has been defaulted.
* lto-wrapper.c (OFFLOAD_TARGET_DEFAULT_ENV): Define.
(compile_offload_image): If OFFLOAD_TARGET_DEFAULT
is in the environment, don't fail if corresponding mkoffload
can't be found.
(compile_images_for_offload_targets): Likewise. Free and clear
offload_names if no valid offload is found.
libgomp/
* target.c (gomp_load_plugin_for_device): If a plugin can't be
dlopened, assume it has no devices silently.
--- a/src/gcc/gcc.c
+++ b/src/gcc/gcc.c
@@ -324,6 +324,10 @@ static const char *spec_host_machine = D
static char *offload_targets = NULL;
+/* Set to true if -foffload has not been used and offload_targets
+ is set to the configured in default. */
+static bool offload_targets_default;
+
/* Nonzero if cross-compiling.
When -b is used, the value comes from the `specs' file. */
@@ -5058,7 +5062,10 @@ process_command (unsigned int decoded_op
/* If the user didn't specify any, default to all configured offload
targets. */
if (ENABLE_OFFLOADING && offload_targets == NULL)
- handle_foffload_option (OFFLOAD_TARGETS);
+ {
+ handle_foffload_option (OFFLOAD_TARGETS);
+ offload_targets_default = true;
+ }
/* Handle -gtoggle as it would later in toplev.c:process_options to
make the debug-level-gt spec function work as expected. */
@@ -8758,6 +8765,8 @@ driver::maybe_putenv_OFFLOAD_TARGETS ()
obstack_grow (&collect_obstack, offload_targets,
strlen (offload_targets) + 1);
xputenv (XOBFINISH (&collect_obstack, char *));
+ if (offload_targets_default)
+ xputenv ("OFFLOAD_TARGET_DEFAULT=1");
}
free (offload_targets);
--- a/src/gcc/lto-wrapper.c
+++ b/src/gcc/lto-wrapper.c
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3.
/* Environment variable, used for passing the names of offload targets from GCC
driver to lto-wrapper. */
#define OFFLOAD_TARGET_NAMES_ENV "OFFLOAD_TARGET_NAMES"
+#define OFFLOAD_TARGET_DEFAULT_ENV "OFFLOAD_TARGET_DEFAULT"
/* By default there is no special suffix for target executables. */
#ifdef TARGET_EXECUTABLE_SUFFIX
@@ -907,6 +908,12 @@ compile_offload_image (const char *targe
break;
}
+ if (!compiler && getenv (OFFLOAD_TARGET_DEFAULT_ENV))
+ {
+ free_array_of_ptrs ((void **) paths, n_paths);
+ return NULL;
+ }
+
if (!compiler)
fatal_error (input_location,
"could not find %s in %s (consider using %<-B%>)",
@@ -976,6 +983,7 @@ compile_images_for_offload_targets (unsi
if (!target_names)
return;
unsigned num_targets = parse_env_var (target_names, &names, NULL);
+ int next_name_entry = 0;
const char *compiler_path = getenv ("COMPILER_PATH");
if (!compiler_path)
@@ -986,13 +994,19 @@ compile_images_for_offload_targets (unsi
offload_names = XCNEWVEC (char *, num_targets + 1);
for (unsigned i = 0; i < num_targets; i++)
{
- offload_names[i]
+ offload_names[next_name_entry]
= compile_offload_image (names[i], compiler_path, in_argc, in_argv,
compiler_opts, compiler_opt_count,
linker_opts, linker_opt_count);
- if (!offload_names[i])
- fatal_error (input_location,
- "problem with building target image for %s", names[i]);
+ if (!offload_names[next_name_entry])
+ continue;
+ next_name_entry++;
+ }
+
+ if (next_name_entry == 0)
+ {
+ free (offload_names);
+ offload_names = NULL;
}
out:
--- a/src/libgomp/target.c
+++ b/src/libgomp/target.c
@@ -3173,7 +3173,7 @@ gomp_load_plugin_for_device (struct gomp
void *plugin_handle = dlopen (plugin_name, RTLD_LAZY);
if (!plugin_handle)
- goto dl_fail;
+ return 0;
/* Check if all required functions are available in the plugin and store
their handlers. None of the symbols can legitimately be NULL,

View File

@@ -0,0 +1,49 @@
# DP: Add FORCE_CROSS_LAYOUT env var to force a cross directory layout.
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -3490,7 +3490,7 @@ target_configargs="$target_configargs ${
# native. However, it would be better to use other mechanisms to make the
# sorts of decisions they want to make on this basis. Please consider
# this option to be deprecated. FIXME.
-if test x${is_cross_compiler} = xyes ; then
+if test x${is_cross_compiler} = xyes || test x${FORCE_CROSS_LAYOUT} = xyes; then
target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}"
fi
--- a/src/gcc/configure.ac
+++ b/src/gcc/configure.ac
@@ -2516,14 +2516,14 @@ SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADE
BUILD_SYSTEM_HEADER_DIR=$SYSTEM_HEADER_DIR AC_SUBST(BUILD_SYSTEM_HEADER_DIR)
if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x ||
- test x$build != x$host || test "x$with_build_sysroot" != x; then
+ test x$build != x$host || test "x$with_build_sysroot" != x || test x$FORCE_CROSS_LAYOUT = xyes; then
if test "x$with_build_sysroot" != x; then
BUILD_SYSTEM_HEADER_DIR=$with_build_sysroot'$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)'
else
BUILD_SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
fi
- if test x$host != x$target
+ if test x$host != x$target || test x$FORCE_CROSS_LAYOUT = xyes
then
CROSS="-DCROSS_DIRECTORY_STRUCTURE"
ALL=all.cross
@@ -7630,14 +7630,14 @@ AC_SUBST_FILE(language_hooks)
# Echo link setup.
if test x${build} = x${host} ; then
- if test x${host} = x${target} ; then
+ if test x${host} = x${target} && test x$FORCE_CROSS_LAYOUT != xyes ; then
echo "Links are now set up to build a native compiler for ${target}." 1>&2
else
echo "Links are now set up to build a cross-compiler" 1>&2
echo " from ${host} to ${target}." 1>&2
fi
else
- if test x${host} = x${target} ; then
+ if test x${host} = x${target} && test x$FORCE_CROSS_LAYOUT != xyes ; then
echo "Links are now set up to build (on ${build}) a native compiler" 1>&2
echo " for ${target}." 1>&2
else

39
debian/patches/gcc-gfdl-build.diff vendored Normal file
View File

@@ -0,0 +1,39 @@
# DP: Build a dummy s-tm-texi without access to the texinfo sources
--- a/src/gcc/Makefile.in
+++ b/src/gcc/Makefile.in
@@ -2757,32 +2757,8 @@ s-tm-texi: $(srcdir)/doc/../doc/tm.texi
# \r is not portable to Solaris tr, therefore we have a special
# case for ASCII. We use \r for other encodings like EBCDIC.
s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in
- $(RUN_GEN) build/genhooks$(build_exeext) -d \
- $(srcdir)/doc/tm.texi.in > tmp-tm.texi
- case `echo X|tr X '\101'` in \
- A) tr -d '\015' < tmp-tm.texi > tmp2-tm.texi ;; \
- *) tr -d '\r' < tmp-tm.texi > tmp2-tm.texi ;; \
- esac
- mv tmp2-tm.texi tmp-tm.texi
- $(SHELL) $(srcdir)/../move-if-change tmp-tm.texi tm.texi
- @if cmp -s $(srcdir)/doc/tm.texi tm.texi; then \
- $(STAMP) $@; \
- elif test $(srcdir)/doc/tm.texi -nt $(srcdir)/doc/tm.texi.in \
- && ( test $(srcdir)/doc/tm.texi -nt $(srcdir)/target.def \
- || test $(srcdir)/doc/tm.texi -nt $(srcdir)/c-family/c-target.def \
- || test $(srcdir)/doc/tm.texi -nt $(srcdir)/common/common-target.def \
- || test $(srcdir)/doc/tm.texi -nt $(srcdir)/d/d-target.def \
- || test $(srcdir)/doc/tm.texi -nt $(srcdir)/rust/rust-target.def \
- ); then \
- echo >&2 ; \
- echo You should edit $(srcdir)/doc/tm.texi.in rather than $(srcdir)/doc/tm.texi . >&2 ; \
- false; \
- else \
- echo >&2 ; \
- echo Verify that you have permission to grant a GFDL license for all >&2 ; \
- echo new text in $(objdir)/tm.texi, then copy it to $(srcdir)/doc/tm.texi. >&2 ; \
- false; \
- fi
+ cat $(srcdir)/doc/tm.texi.in > tmp-tm.texi
+ $(STAMP) $@
$(GIMPLE_MATCH_PD_SEQ_SRC): s-gimple-match gimple-match-head.cc; @true
gimple-match-auto.h: s-gimple-match; @true

164
debian/patches/gcc-hash-style-gnu.diff vendored Normal file
View File

@@ -0,0 +1,164 @@
# DP: Link using --hash-style=gnu (aarch64, alpha, amd64, armel, armhf, ia64,
# DP: i386, powerpc, ppc64, riscv64, s390, sparc)
2006-07-11 Jakub Jelinek <jakub@redhat.com>
* config/i386/linux.h (LINK_SPEC): Add --hash-style=gnu.
* config/i386/linux64.h (LINK_SPEC): Likewise.
* config/rs6000/sysv4.h (LINK_OS_LINUX_SPEC): Likewise.
* config/rs6000/linux64.h (LINK_OS_LINUX_SPEC32,
LINK_OS_LINUX_SPEC64): Likewise.
* config/s390/linux.h (LINK_SPEC): Likewise.
* config/ia64/linux.h (LINK_SPEC): Likewise.
* config/sparc/linux.h (LINK_SPEC): Likewise.
* config/sparc/linux64.h (LINK_SPEC, LINK_ARCH32_SPEC,
LINK_ARCH64_SPEC): Likewise.
* config/alpha/linux-elf.h (LINK_SPEC): Likewise.
2009-12-21 Matthias Klose <doko@ubuntu.com>
* config/arm/linux-elf.h (LINK_SPEC): Add --hash-style=gnu.
2012-11-17 Matthias Klose <doko@ubuntu.com>
* config/aarch64/aarch64-linux.h (LINK_SPEC): Add --hash-style=gnu.
2018-03-02 Aurelien Jarno <aurelien@aurel32.net>
* config/riscv/linux.h (LINK_SPEC): Add --hash-style=gnu.
---
gcc/config/alpha/linux-elf.h | 2 +-
gcc/config/i386/linux.h | 2 +-
gcc/config/i386/linux64.h | 2 +-
gcc/config/ia64/linux.h | 2 +-
gcc/config/rs6000/linux64.h | 4 ++--
gcc/config/rs6000/sysv4.h | 2 +-
gcc/config/s390/linux.h | 2 +-
gcc/config/sparc/linux.h | 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)
--- a/src/gcc/config/alpha/linux-elf.h
+++ b/src/gcc/config/alpha/linux-elf.h
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3.
#define ELF_DYNAMIC_LINKER GNU_USER_DYNAMIC_LINKER
-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
+#define LINK_SPEC "-m elf64alpha --hash-style=gnu %{G*} %{relax:-relax} \
%{O*:-O3} %{!O*:-O1} \
%{shared:-shared} \
%{!shared: \
--- a/src/gcc/config/ia64/linux.h
+++ b/src/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do { \
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
#undef LINK_SPEC
-#define LINK_SPEC "\
+#define LINK_SPEC " --hash-style=gnu \
%{shared:-shared} \
%{!shared: \
%{!static: \
--- a/src/gcc/config/rs6000/linux64.h
+++ b/src/gcc/config/rs6000/linux64.h
@@ -378,13 +378,13 @@ extern int dot_symbols;
" -m elf64ppc")
#endif
-#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " --hash-style=gnu %{!shared: %{!static: \
%{!static-pie: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}} \
%(link_os_extra_spec32)"
-#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " --hash-style=gnu %{!shared: %{!static: \
%{!static-pie: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
--- a/src/gcc/config/rs6000/sysv4.h
+++ b/src/gcc/config/rs6000/sysv4.h
@@ -781,7 +781,7 @@ GNU_USER_TARGET_CC1_SPEC
#define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
#endif
-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --hash-style=gnu %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
--- a/src/gcc/config/s390/linux.h
+++ b/src/gcc/config/s390/linux.h
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3.
#undef LINK_SPEC
#define LINK_SPEC \
- "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
+ "%{m31:-m elf_s390}%{m64:-m elf64_s390} --hash-style=gnu \
%{shared:-shared} \
%{!shared: \
%{static:-static} \
--- a/src/gcc/config/sparc/linux.h
+++ b/src/gcc/config/sparc/linux.h
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
#undef LINK_SPEC
-#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
+#define LINK_SPEC "-m elf32_sparc --hash-style=gnu %{shared:-shared} \
%{!mno-relax:%{!r:-relax}} \
%{!shared: \
%{!static: \
--- a/src/gcc/config/arm/linux-elf.h
+++ b/src/gcc/config/arm/linux-elf.h
@@ -70,6 +70,7 @@
%{rdynamic:-export-dynamic} \
%{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
-X \
+ --hash-style=gnu \
%{mbig-endian:-EB} %{mlittle-endian:-EL}" \
SUBTARGET_EXTRA_LINK_SPEC
--- a/src/gcc/config/i386/gnu-user.h
+++ b/src/gcc/config/i386/gnu-user.h
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3.
{ "link_emulation", GNU_USER_LINK_EMULATION },\
{ "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
-#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --hash-style=gnu %{shared:-shared} \
%{!shared: \
%{!static: \
%{!static-pie: \
--- a/src/gcc/config/i386/gnu-user64.h
+++ b/src/gcc/config/i386/gnu-user64.h
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTI
"%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
%{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
%{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
+ --hash-style=gnu \
%{shared:-shared} \
%{!shared: \
%{!static: \
--- a/src/gcc/config/aarch64/aarch64-linux.h
+++ b/src/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
#define CPP_SPEC "%{pthread:-D_REENTRANT}"
#define LINUX_TARGET_LINK_SPEC "%{h*} \
+ --hash-style=gnu \
%{static:-Bstatic} \
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
--- a/src/gcc/config/riscv/linux.h
+++ b/src/gcc/config/riscv/linux.h
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3.
"%{mabi=ilp32:_ilp32}"
#define LINK_SPEC "\
+-hash-style=gnu \
-melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \
%{mno-relax:--no-relax} \
-X \

39
debian/patches/gcc-ice-apport.diff vendored Normal file
View File

@@ -0,0 +1,39 @@
# DP: Report an ICE to apport (if apport is available
# DP: and the environment variable GCC_NOAPPORT is not set)
--- a/src/gcc/gcc.cc
+++ b/src/gcc/gcc.cc
@@ -8123,13 +8123,16 @@ do_report_bug (const char **new_argv, co
if (status == ATTEMPT_STATUS_SUCCESS)
{
const bool gcc_dump = has_deb_build_options ("gcc-ice", "nodump");
+ const bool gcc_apport
+ = !env.get ("GCC_NOAPPORT")
+ && !access ("/usr/share/apport/gcc_ice_hook", R_OK | X_OK);
if (gcc_dump)
fnotice (stderr,
"Preprocessed source stored into %s file,"
" please attach this to your bugreport.\n",
*out_file);
- if (gcc_dump)
+ if (gcc_dump || gcc_apport)
{
char *cmd = XNEWVEC (char, 50 + strlen (*out_file));
@@ -8143,6 +8146,15 @@ do_report_bug (const char **new_argv, co
fflush (stderr);
free (cmd);
}
+ if (gcc_apport)
+ {
+ char *cmd
+ = XNEWVEC (char, 50 + strlen (*out_file) + strlen (new_argv[0]));
+ sprintf (cmd, "/usr/share/apport/gcc_ice_hook %s %s", new_argv[0],
+ *out_file);
+ system (cmd);
+ free (cmd);
+ }
/* Make sure it is not deleted. */
free (*out_file);
*out_file = NULL;

111
debian/patches/gcc-ice-dump.diff vendored Normal file
View File

@@ -0,0 +1,111 @@
# DP: For ICEs, dump the preprocessed source file to stderr
# DP: when in a distro build environment.
--- a/src/gcc/gcc.cc
+++ b/src/gcc/gcc.cc
@@ -3140,6 +3140,61 @@ access_check (const char *name, int mode
return access (name, mode);
}
+/* Check whether options line contains the specified variable, and
+ optionally set to the supplied value */
+
+static bool
+check_options (const char *options, const char *var = nullptr,
+ const char *val = nullptr)
+{
+ if (!var)
+ return false;
+
+ const char *const var_found = strstr (options, var);
+ if (!var_found)
+ return false;
+
+ if (val)
+ {
+ if (var_found[strlen (var)] != '=')
+ return false;
+
+ const char *var_end = strchr (var_found, ' ');
+ if (!var_end)
+ var_end = strchr (var_found, '\0');
+
+ const char *const val_found = strstr (var_found, val);
+ if (!val_found || val_found > var_end)
+ return false;
+
+ const char c0 = val_found[-1];
+ const char c1 = val_found[strlen (val)];
+ if ((c0 == '=' || c0 == ',') && (c1 == ',' || c1 == ' ' || c1 == '\0'))
+ return true;
+ }
+ else
+ {
+ const char c1 = var_found[strlen (var)];
+ if (c1 == ' ' || c1 == '\0')
+ return true;
+ }
+ return false;
+}
+
+/* Check whether DEB_BUILD_OPTIONS environment variable is set, and
+ that it does not contain the specified exclusion keyword. */
+
+static bool
+has_deb_build_options (const char *exclude_var = nullptr,
+ const char *exclude_val = nullptr)
+{
+ const char *const deb_build_options = env.get ("DEB_BUILD_OPTIONS");
+ if (!deb_build_options)
+ return false;
+
+ return !check_options (deb_build_options, exclude_var, exclude_val);
+}
+
/* Callback for find_a_file. Appends the file name to the directory
path. If the resulting file exists in the right mode, return the
full pathname to the file. */
@@ -3666,9 +3721,10 @@ execute (void)
/* For ICEs in cc1, cc1obj, cc1plus see if it is
reproducible or not. */
const char *p;
- if (flag_report_bug
- && WEXITSTATUS (status) == ICE_EXIT_CODE
- && i == 0
+ const bool deb_build_options
+ = has_deb_build_options ("gcc-ice", "norepro");
+ if ((flag_report_bug || deb_build_options)
+ && WEXITSTATUS (status) == ICE_EXIT_CODE && i == 0
&& (p = strrchr (commands[0].argv[0], DIR_SEPARATOR))
&& startswith (p + 1, "cc1"))
try_generate_repro (commands[0].argv);
@@ -8066,8 +8122,27 @@ do_report_bug (const char **new_argv, co
if (status == ATTEMPT_STATUS_SUCCESS)
{
- fnotice (stderr, "Preprocessed source stored into %s file,"
- " please attach this to your bugreport.\n", *out_file);
+ const bool gcc_dump = has_deb_build_options ("gcc-ice", "nodump");
+
+ if (gcc_dump)
+ fnotice (stderr,
+ "Preprocessed source stored into %s file,"
+ " please attach this to your bugreport.\n",
+ *out_file);
+ if (gcc_dump)
+ {
+ char *cmd = XNEWVEC (char, 50 + strlen (*out_file));
+
+ sprintf (cmd, "/usr/bin/awk '{print \"%d:\", $0}' %s >&2", getpid (),
+ *out_file);
+ fprintf (stderr, "=== BEGIN GCC DUMP ===\n");
+ fflush (stderr);
+ system (cmd);
+ fflush (stderr);
+ fprintf (stderr, "=== END GCC DUMP ===\n");
+ fflush (stderr);
+ free (cmd);
+ }
/* Make sure it is not deleted. */
free (*out_file);
*out_file = NULL;

View File

@@ -0,0 +1,16 @@
From 6a616afb8dadcd33506001914f5ca6fa37749b6b Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Sun, 8 Jun 2025 07:59:26 +0200
Subject: [PATCH] Disable fold-mem-offsets, only applied for m68k
--- a/src/gcc/doc/invoke.texi
+++ b/src/gcc/doc/invoke.texi
@@ -15255,6 +15255,8 @@ Try to eliminate add instructions by fol
Enabled at levels @option{-O2}, @option{-O3}.
+NOTE: On Debian/Ubuntu this is disabled by default on m68k-linux-gnu.
+
@opindex fcprop-registers
@item -fcprop-registers
After register allocation and post-register allocation instruction splitting,

View File

@@ -0,0 +1,25 @@
From 6a616afb8dadcd33506001914f5ca6fa37749b6b Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Sun, 8 Jun 2025 07:59:26 +0200
Subject: [PATCH] Disable fold-mem-offsets, only applied for m68k
---
gcc/common.opt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/common.opt b/gcc/common.opt
index 0e50305dde8..e57dff18af7 100644
--- a/src/gcc/common.opt
+++ b/src/gcc/common.opt
@@ -1295,7 +1295,7 @@ Common Var(flag_cprop_registers) Optimization
Perform a register copy-propagation optimization pass.
ffold-mem-offsets
-Common Var(flag_fold_mem_offsets) Init(1) Optimization
+Common Var(flag_fold_mem_offsets) Init(0) Optimization
Fold instructions calculating memory offsets to the memory access instruction if possible.
fcrossjumping
--
2.49.0

189
debian/patches/gcc-multiarch.diff vendored Normal file
View File

@@ -0,0 +1,189 @@
# DP: - Remaining multiarch patches, not yet submitted upstream.
# DP: - Add MULTIARCH_DIRNAME definitions for multilib configurations,
# DP: which are used for the non-multilib builds.
2013-06-12 Matthias Klose <doko@ubuntu.com>
* config/i386/t-linux64: Set MULTIARCH_DIRNAME.
* config.gcc (i[34567]86-*-linux* | x86_64-*-linux*): Prepend
i386/t-linux to $tmake_file;
set default ABI to N64 for mips64el.
* config/mips/t-linux64: Set MULTIARCH_DIRNAME.
* config/rs6000/t-linux64: Set MULTIARCH_DIRNAME.
* config/s390/t-linux64: Set MULTIARCH_DIRNAME.
* config/sparc/t-linux64: Set MULTIARCH_DIRNAME.
* src/gcc/config/mips/mips.h: (/usr)/lib as default path.
--- a/src/gcc/config/sh/t-linux
+++ b/src/gcc/config/sh/t-linux
@@ -1,3 +1,11 @@
MULTILIB_DIRNAMES=
MULTILIB_MATCHES=
+
+ifneq (,$(findstring sh4,$(target)))
+MULTILIB_OSDIRNAMES = .:sh4-linux-gnu sh4_nofpu-linux-gnu:sh4-linux-gnu
+MULTIARCH_DIRNAME = $(call if_multiarch,sh4-linux-gnu)
+else
+MULTILIB_OSDIRNAMES = .:sh3-linux-gnu sh3_nofpu-linux-gnu:sh3-linux-gnu
+MULTIARCH_DIRNAME = $(call if_multiarch,sh3-linux-gnu)
+endif
MULTILIB_EXCEPTIONS=m1 mb/m1 m2a
--- a/src/gcc/config/sparc/t-linux64
+++ b/src/gcc/config/sparc/t-linux64
@@ -27,3 +27,5 @@ MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:sparc64-linux-gnu)
MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:sparc-linux-gnu)
+
+MULTIARCH_DIRNAME = $(call if_multiarch,sparc$(if $(findstring 64,$(target)),64)-linux-gnu)
--- a/src/gcc/config/s390/t-linux64
+++ b/src/gcc/config/s390/t-linux64
@@ -9,3 +9,5 @@ MULTILIB_OPTIONS = m64/m31
MULTILIB_DIRNAMES = 64 32
MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
+
+MULTIARCH_DIRNAME = $(call if_multiarch,s390$(if $(findstring s390x,$(target)),x)-linux-gnu)
--- a/src/gcc/config/rs6000/t-linux64
+++ b/src/gcc/config/rs6000/t-linux64
@@ -31,6 +31,8 @@ MULTILIB_EXTRA_OPTS :=
MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
+MULTIARCH_DIRNAME = $(call if_multiarch,powerpc$(if $(findstring 64,$(target)),64)-linux-gnu)
+
rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.cc
$(COMPILE) $<
$(POSTCOMPILE)
--- a/src/gcc/config/i386/t-linux64
+++ b/src/gcc/config/i386/t-linux64
@@ -36,3 +36,13 @@ MULTILIB_DIRNAMES = $(patsubst m%, %,
MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
+
+ifneq (,$(findstring x86_64,$(target)))
+ ifneq (,$(findstring biarchx32.h,$(tm_include_list)))
+ MULTIARCH_DIRNAME = $(call if_multiarch,x86_64-linux-gnux32)
+ else
+ MULTIARCH_DIRNAME = $(call if_multiarch,x86_64-linux-gnu)
+ endif
+else
+ MULTIARCH_DIRNAME = $(call if_multiarch,i386-linux-gnu)
+endif
--- a/src/gcc/config/mips/t-linux64
+++ b/src/gcc/config/mips/t-linux64
@@ -18,24 +18,28 @@
MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
MULTILIB_DIRNAMES = n32 32 64
+MIPS_R6 = $(if $(findstring r6, $(firstword $(subst -, ,$(target)))),r6)
+MIPS_32 = $(if $(findstring r6, $(firstword $(subst -, ,$(target)))),32)
+MIPS_ISA = $(if $(findstring r6, $(firstword $(subst -, ,$(target)))),isa)
MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
+
ifeq (yes,$(enable_multiarch))
ifneq (,$(findstring gnuabi64,$(target)))
MULTILIB_OSDIRNAMES = \
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../libo32$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
+ ../lib32$(call if_multiarch,:mips$(MIPS_ISA)64$(MIPS_R6)$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
+ ../libo32$(call if_multiarch,:mips$(MIPS_ISA)$(MIPS_32)$(MIPS_R6)$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
+ ../lib$(call if_multiarch,:mips$(MIPS_ISA)64$(MIPS_R6)$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
else ifneq (,$(findstring gnuabin32,$(target)))
MULTILIB_OSDIRNAMES = \
- ../lib$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../libo32$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
+ ../lib$(call if_multiarch,:mips$(MIPS_ISA)64$(MIPS_R6)$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
+ ../libo32$(call if_multiarch,:mips$(MIPS_ISA)$(MIPS_32)$(MIPS_R6)$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
+ ../lib64$(call if_multiarch,:mips$(MIPS_ISA)64$(MIPS_R6)$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
else
MULTILIB_OSDIRNAMES = \
- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
+ ../lib32$(call if_multiarch,:mips$(MIPS_ISA)64$(MIPS_R6)$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
+ ../lib$(call if_multiarch,:mips$(MIPS_ISA)$(MIPS_32)$(MIPS_R6)$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
+ ../lib64$(call if_multiarch,:mips$(MIPS_ISA)64$(MIPS_R6)$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
endif
else
MULTILIB_OSDIRNAMES = \
@@ -43,3 +47,13 @@ else
../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
endif
+
+ifneq (,$(findstring abin32,$(target)))
+MULTIARCH_DIRNAME = $(call if_multiarch,mips$(MIPS_ISA)64$(MIPS_R6)$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT))
+else
+ifneq (,$(findstring abi64,$(target)))
+MULTIARCH_DIRNAME = $(call if_multiarch,mips$(MIPS_ISA)64$(MIPS_R6)$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
+else
+MULTIARCH_DIRNAME = $(call if_multiarch,mips$(MIPS_ISA)$(MIPS_32)$(MIPS_R6)$(MIPS_EL)-linux-gnu$(MIPS_SOFT))
+endif
+endif
--- a/src/gcc/config.gcc
+++ b/src/gcc/config.gcc
@@ -2606,7 +2606,8 @@ mips*-*-linux*) # Linux MIPS, either
extra_options="${extra_options} linux-android.opt"
case ${target} in
mipsisa32r6*)
- default_mips_arch=mips32r6
+ with_arch_32="mips32r6"
+ with_arch_64="mips64r6"
;;
mipsisa32r2*)
default_mips_arch=mips32r2
@@ -2628,7 +2629,8 @@ mips*-*-linux*) # Linux MIPS, either
;;
mipsisa64r6*-*-linux-gnuabi64)
default_mips_abi=64
- default_mips_arch=mips64r6
+ with_arch_32="mips32r6"
+ with_arch_64="mips64r6"
enable_mips_multilibs="yes"
;;
mipsisa64r6*-*-linux*)
@@ -5845,7 +5847,7 @@ case ${target} in
;;
i[34567]86-*-linux* | x86_64-*-linux*)
extra_objs="${extra_objs} gnu-property.o"
- tmake_file="$tmake_file i386/t-linux i386/t-gnu-property"
+ tmake_file="i386/t-linux $tmake_file i386/t-gnu-property"
;;
i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu)
tmake_file="$tmake_file i386/t-kfreebsd"
--- a/src/gcc/Makefile.in
+++ b/src/gcc/Makefile.in
@@ -582,7 +582,7 @@ BUILD_SYSTEM_HEADER_DIR = `echo @BUILD_S
STMP_FIXINC = @STMP_FIXINC@
# Test to see whether <limits.h> exists in the system header files.
-LIMITS_H_TEST = [ -f $(BUILD_SYSTEM_HEADER_DIR)/limits.h ]
+LIMITS_H_TEST = [ -f $(BUILD_SYSTEM_HEADER_DIR)/limits.h -o -f $(BUILD_SYSTEM_HEADER_DIR)/$(MULTIARCH_DIRNAME)/limits.h ]
# Directory for prefix to system directories, for
# each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
--- a/src/gcc/config/aarch64/t-aarch64-linux
+++ b/src/gcc/config/aarch64/t-aarch64-linux
@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
LIB1ASMFUNCS = _aarch64_sync_cache_range
AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
+MULTILIB_OSDIRNAMES = mabi.lp64=../lib$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu_ilp32)
--- a/src/gcc/config/arc/t-multilib-linux
+++ b/src/gcc/config/arc/t-multilib-linux
@@ -23,3 +23,6 @@ MULTILIB_DIRNAMES = hs archs hs38 hs38_l
# Aliases:
MULTILIB_MATCHES += mcpu?arc700=mA7
MULTILIB_MATCHES += mcpu?arc700=mARC700
+
+MULTILIB_OSDIRNAMES =
+MULTIARCH_DIRNAME = $(call if_multiarch,arc-linux-gnu)

View File

@@ -0,0 +1,100 @@
# DP: Don't auto-detect multilib osdirnames.
--- a/src/gcc/config/sparc/t-linux64
+++ b/src/gcc/config/sparc/t-linux64
@@ -25,7 +25,12 @@
MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
+ifneq (,$(findstring sparc64,$(target)))
+MULTILIB_OSDIRNAMES = ../lib$(call if_multiarch,:sparc64-linux-gnu)
+MULTILIB_OSDIRNAMES += ../lib32$(call if_multiarch,:sparc-linux-gnu)
+else
MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:sparc64-linux-gnu)
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:sparc-linux-gnu)
+MULTILIB_OSDIRNAMES += ../lib$(call if_multiarch,:sparc-linux-gnu)
+endif
MULTIARCH_DIRNAME = $(call if_multiarch,sparc$(if $(findstring 64,$(target)),64)-linux-gnu)
--- a/src/gcc/config/s390/t-linux64
+++ b/src/gcc/config/s390/t-linux64
@@ -7,7 +7,12 @@
MULTILIB_OPTIONS = m64/m31
MULTILIB_DIRNAMES = 64 32
+ifneq (,$(findstring s390x,$(target)))
+MULTILIB_OSDIRNAMES = ../lib$(call if_multiarch,:s390x-linux-gnu)
+MULTILIB_OSDIRNAMES += ../lib32$(call if_multiarch,:s390-linux-gnu)
+else
MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
-MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
+MULTILIB_OSDIRNAMES += ../lib$(call if_multiarch,:s390-linux-gnu)
+endif
MULTIARCH_DIRNAME = $(call if_multiarch,s390$(if $(findstring s390x,$(target)),x)-linux-gnu)
--- a/src/gcc/config/rs6000/t-linux64
+++ b/src/gcc/config/rs6000/t-linux64
@@ -28,8 +28,13 @@
MULTILIB_OPTIONS := m64/m32
MULTILIB_DIRNAMES := 64 32
MULTILIB_EXTRA_OPTS :=
+ifneq (,$(findstring powerpc64,$(target)))
+MULTILIB_OSDIRNAMES := m64=../lib$(call if_multiarch,:powerpc64-linux-gnu)
+MULTILIB_OSDIRNAMES += m32=../lib32$(call if_multiarch,:powerpc-linux-gnu)
+else
MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
+MULTILIB_OSDIRNAMES += m32=../lib$(call if_multiarch,:powerpc-linux-gnu)
+endif
MULTIARCH_DIRNAME = $(call if_multiarch,powerpc$(if $(findstring 64,$(target)),64)-linux-gnu)
--- a/src/gcc/config/i386/t-linux64
+++ b/src/gcc/config/i386/t-linux64
@@ -33,9 +33,19 @@
comma=,
MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+ifneq (,$(findstring gnux32,$(target)))
MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
+MULTILIB_OSDIRNAMES+= m32=../lib32$(call if_multiarch,:i386-linux-gnu)
+MULTILIB_OSDIRNAMES+= mx32=../lib$(call if_multiarch,:x86_64-linux-gnux32)
+else ifneq (,$(findstring x86_64,$(target)))
+MULTILIB_OSDIRNAMES = m64=../lib$(call if_multiarch,:x86_64-linux-gnu)
+MULTILIB_OSDIRNAMES+= m32=../lib32$(call if_multiarch,:i386-linux-gnu)
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
+else
+MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
+MULTILIB_OSDIRNAMES+= m32=../lib$(call if_multiarch,:i386-linux-gnu)
+MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
+endif
ifneq (,$(findstring x86_64,$(target)))
ifneq (,$(findstring biarchx32.h,$(tm_include_list)))
--- a/src/gcc/config/rs6000/t-linux
+++ b/src/gcc/config/rs6000/t-linux
@@ -2,7 +2,7 @@
# or soft-float.
ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float)))
ifneq (,$(findstring powerpc64,$(target)))
-MULTILIB_OSDIRNAMES := .=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+MULTILIB_OSDIRNAMES := .=../lib$(call if_multiarch,:powerpc64-linux-gnu)
else
MULTIARCH_DIRNAME := $(call if_multiarch,powerpc-linux-gnu)
endif
--- a/src/gcc/config/loongarch/t-linux
+++ b/src/gcc/config/loongarch/t-linux
@@ -16,9 +16,9 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-MULTIOSDIR_lp64d := ../lib64$(call if_multiarch,:loongarch64-linux-gnu)
-MULTIOSDIR_lp64f := ../lib64/f32$(call if_multiarch,:loongarch64-linux-gnuf32)
-MULTIOSDIR_lp64s := ../lib64/sf$(call if_multiarch,:loongarch64-linux-gnusf)
+MULTIOSDIR_lp64d := ../lib$(call if_multiarch,:loongarch64-linux-gnu)
+MULTIOSDIR_lp64f := ../lib/f32$(call if_multiarch,:loongarch64-linux-gnuf32)
+MULTIOSDIR_lp64s := ../lib/sf$(call if_multiarch,:loongarch64-linux-gnusf)
# Don't define MULTILIB_OSDIRNAMES if multilib is disabled.
ifeq ($(filter LA_DISABLE_MULTILIB,$(tm_defines)),)

View File

@@ -0,0 +1,61 @@
# DP: Don't run the gnat and gm2 tests for multilibs, which are not built
--- a/src/gcc/Makefile.in
+++ b/src/gcc/Makefile.in
@@ -4399,7 +4399,12 @@ $(filter-out $(lang_checks_parallelized)
if [ -f $${rootme}/../expect/expect ] ; then \
TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
export TCL_LIBRARY ; fi ; \
- $(RUNTEST) --tool $* $(RUNTESTFLAGS))
+ case "$*" in \
+ (gnat*|gm2*) rtflags=$$(printf '%s' '$(RUNTESTFLAGS)' | sed -E 's/,-m[a-z2-6=]+//g');; \
+ (*) rtflags=$(RUNTESTFLAGS);; \
+ esac; \
+ echo "CHECK TARGET: $* -> $$rtflags"; \
+ $(RUNTEST) --tool $* $$rtflags)
$(patsubst %,%-subtargets,$(lang_checks)): check-%-subtargets:
@echo check-$*
@@ -4433,12 +4438,17 @@ check_p_subdirs=$(wordlist 1,$(check_p_c
# testsuites like objc or go.
$(lang_checks_parallelized): check-% : site.exp
-rm -rf $(TESTSUITEDIR)/$*-parallel
- @if [ -n "$(filter -j%, $(MFLAGS))" ]; then \
+ @case "$*" in \
+ (gnat*|gm2*) rtflags=$$(printf '%s' '$(RUNTESTFLAGS)' | sed -E 's/,-m[a-z2-6=]+//g');; \
+ (*) rtflags=$(RUNTESTFLAGS);; \
+ esac; \
+ echo "CHECK TARGET: $* -> $$rtflags"; \
+ if [ -n "$(filter -j%, $(MFLAGS))" ]; then \
test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) || true; \
test -d $(TESTSUITEDIR)/$*-parallel || mkdir $(TESTSUITEDIR)/$*-parallel || true; \
GCC_RUNTEST_PARALLELIZE_DIR=`${PWD_COMMAND}`/$(TESTSUITEDIR)/$(check_p_tool)-parallel ; \
export GCC_RUNTEST_PARALLELIZE_DIR ; \
- $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \
+ $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$$rtflags" \
EXPECT=$(EXPECT) \
check-parallel-$* \
$(patsubst %,check-parallel-$*_%, $(check_p_subdirs)); \
@@ -4457,7 +4467,7 @@ $(lang_checks_parallelized): check-% : s
> $(TESTSUITEDIR)/$*/$*.log; \
rm -rf $(TESTSUITEDIR)/$*-parallel || true; \
else \
- $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \
+ $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$$rtflags" \
EXPECT=$(EXPECT) \
check_$*_parallelize= check-parallel-$*; \
fi
@@ -4483,7 +4493,12 @@ check-parallel-% : site.exp
TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
export TCL_LIBRARY ; \
fi ; \
- $(RUNTEST) --tool $(check_p_tool) $(RUNTESTFLAGS); \
+ case "$*" in \
+ (gnat*|gm2*) rtflags=$$(printf '%s' '$(RUNTESTFLAGS)' | sed -E 's/,-m[a-z2-6=]+//g');; \
+ (*) rtflags=$(RUNTESTFLAGS);; \
+ esac; \
+ echo "CHECK TARGET: $* -> $$rtflags"; \
+ $(RUNTEST) --tool $(check_p_tool) $$rtflags; \
if [ -n "$$GCC_RUNTEST_PARALLELIZE_DIR" ] ; then \
touch $${rootme}/$(TESTSUITEDIR)/$(check_p_tool)-parallel/finished; \
fi ; \

View File

@@ -0,0 +1,37 @@
# DP: Search for the <triplet>-as / -ld before serching for as / ld.
--- a/src/gcc/gcc.cc
+++ b/src/gcc/gcc.cc
@@ -2937,6 +2937,7 @@ for_each_path (const struct path_prefix
{
len = paths->max_len + extra_space + 1;
len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len);
+ len += MAX (strlen(DEFAULT_REAL_TARGET_MACHINE), multiarch_len) + 2; /* triplet prefix for as, ld. */
path = XNEWVEC (char, len);
}
@@ -3150,6 +3151,24 @@ file_at_path (char *path, void *data)
struct file_at_path_info *info = (struct file_at_path_info *) data;
size_t len = strlen (path);
+ /* search for the <triplet>-as / -ld first. */
+ if (! strcmp (info->name, "as") || ! strcmp (info->name, "ld"))
+ {
+ struct file_at_path_info prefix_info = *info;
+ char *prefixed_name = XNEWVEC (char, info->name_len + 2
+ + strlen (DEFAULT_REAL_TARGET_MACHINE));
+ strcpy (prefixed_name, DEFAULT_REAL_TARGET_MACHINE);
+ strcat (prefixed_name, "-");
+ strcat (prefixed_name, info->name);
+ prefix_info.name = (const char *) prefixed_name;
+ prefix_info.name_len = strlen (prefixed_name);
+ if (file_at_path (path, &prefix_info))
+ {
+ XDELETEVEC (prefixed_name);
+ return path;
+ }
+ XDELETEVEC (prefixed_name);
+ }
memcpy (path + len, info->name, info->name_len);
len += info->name_len;

View File

@@ -0,0 +1,13 @@
# DP: Search $(builddir)/sys-include for the asm header files
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -3631,7 +3631,7 @@ fi
# being built; programs in there won't even run.
if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
# Search for pre-installed headers if nothing else fits.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -isystem $(CURDIR)/sys-include'
fi
if test "x${use_gnu_ld}" = x &&

86
debian/patches/gcc-textdomain.diff vendored Normal file
View File

@@ -0,0 +1,86 @@
# DP: Set gettext's domain and textdomain to the versioned package name.
--- a/src/gcc/intl.cc
+++ b/src/gcc/intl.cc
@@ -55,8 +55,8 @@ gcc_init_libintl (void)
setlocale (LC_ALL, "");
#endif
- (void) bindtextdomain ("gcc", LOCALEDIR);
- (void) textdomain ("gcc");
+ (void) bindtextdomain ("gcc-14", LOCALEDIR);
+ (void) textdomain ("gcc-14");
/* Opening quotation mark. */
open_quote = _("`");
--- a/src/gcc/Makefile.in
+++ b/src/gcc/Makefile.in
@@ -4575,8 +4575,8 @@ install-po:
dir=$(localedir)/$$lang/LC_MESSAGES; \
echo $(mkinstalldirs) $(DESTDIR)$$dir; \
$(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
- echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
- $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
+ echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc-14.mo; \
+ $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc-14.mo; \
done
# Rule for regenerating the message template (gcc.pot).
--- a/src/libcpp/init.cc
+++ b/src/libcpp/init.cc
@@ -183,7 +183,7 @@ init_library (void)
init_trigraph_map ();
#ifdef ENABLE_NLS
- (void) bindtextdomain (PACKAGE, LOCALEDIR);
+ (void) bindtextdomain (PACKAGE PACKAGE_SUFFIX, LOCALEDIR);
#endif
}
}
--- a/src/libcpp/system.h
+++ b/src/libcpp/system.h
@@ -284,7 +284,7 @@ extern int errno;
#endif
#ifndef _
-# define _(msgid) dgettext (PACKAGE, msgid)
+# define _(msgid) dgettext (PACKAGE PACKAGE_SUFFIX, msgid)
#endif
#ifndef N_
--- a/src/libcpp/Makefile.in
+++ b/src/libcpp/Makefile.in
@@ -49,6 +49,7 @@ LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
PACKAGE = @PACKAGE@
+PACKAGE_SUFFIX = -14
RANLIB = @RANLIB@
SHELL = @SHELL@
USED_CATALOGS = @USED_CATALOGS@
@@ -73,11 +74,12 @@ depcomp = $(SHELL) $(srcdir)/../depcomp
INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \
-I$(srcdir)/include
+DEBCPPFLAGS += -DPACKAGE_SUFFIX=\"$(strip $(PACKAGE_SUFFIX))\"
ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS) $(PICFLAG) \
- $(CET_HOST_FLAGS)
+ $(CET_HOST_FLAGS) $(DEBCPPFLAGS)
ALL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(NOEXCEPTION_FLAGS) $(INCLUDES) \
- $(CPPFLAGS) $(PICFLAG) $(CET_HOST_FLAGS)
+ $(CPPFLAGS) $(PICFLAG) $(CET_HOST_FLAGS) $(DEBCPPFLAGS)
# The name of the compiler to use.
COMPILER = $(CXX)
@@ -166,8 +168,8 @@ install-strip install: all installdirs
else continue; \
fi; \
dir=$(localedir)/$$lang/LC_MESSAGES; \
- echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
- $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+ echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(PACKAGE_SUFFIX).mo; \
+ $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(PACKAGE_SUFFIX).mo; \
done
mostlyclean:

View File

@@ -0,0 +1,13 @@
# DP: Prefix LLINKER with /usr/bin/time -v
--- a/src/gcc/Makefile.in
+++ b/src/gcc/Makefile.in
@@ -312,7 +312,7 @@ LINKER += $(LD_PICFLAG)
ifeq (@DO_LINK_MUTEX@,true)
LLINKER = $(SHELL) $(srcdir)/lock-and-run.sh linkfe.lck $(LINKER)
else
-LLINKER = $(LINKER)
+LLINKER = /usr/bin/time -v $(LINKER)
endif
THIN_ARCHIVE_SUPPORT = @thin_archive_support@

15
debian/patches/gcc-vhdl.diff vendored Normal file
View File

@@ -0,0 +1,15 @@
# DP: Make vhdl known to the PPC backend. See
# DP: https://github.com/ghdl/ghdl/blob/master/doc/development/building/GCC.rst
--- a/src/gcc/config/rs6000/rs6000-logue.cc
+++ b/src/gcc/config/rs6000/rs6000-logue.cc
@@ -5341,7 +5341,8 @@ rs6000_output_function_epilogue (FILE *f
|| ! strcmp (language_string, "GNU Go")
|| ! strcmp (language_string, "GNU D")
|| ! strcmp (language_string, "GNU Rust")
- || ! strcmp (language_string, "libgccjit"))
+ || ! strcmp (language_string, "libgccjit")
+ || ! strcmp (language_string, "vhdl"))
i = 0;
else if (! strcmp (language_string, "GNU F77")
|| lang_GNU_Fortran ())

View File

@@ -0,0 +1,12 @@
# DP: Ignore gccrs bootstrap comparison failures on mipsel.
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -4009,6 +4009,7 @@ compare_exclusions="$compare_exclusions
compare_exclusions="$compare_exclusions | gcc/m2/gm2version*"
case "$target" in
hppa*64*-*-hpux*) ;;
+ mipsel-*linux-gnu) compare_exclusions="$compare_exclusions | gcc/rust/rust-macro-builtins.o | gcc/rust/rust-session-manager.o | gcc/rust/rust-cfg-parser.o | gcc/rust/rust-lex.o" ;;
powerpc*-ibm-aix*) compare_exclusions="$compare_exclusions | *libgomp*\$(objext)" ;;
esac
AC_SUBST(compare_exclusions)

View File

@@ -0,0 +1,17 @@
# DP: Dynamically link the phobos library.
--- a/src/gcc/d/d-spec.cc
+++ b/src/gcc/d/d-spec.cc
@@ -426,9 +426,9 @@ lang_specific_driver (cl_decoded_option
/* Add `-lgphobos' if we haven't already done so. */
if (phobos_library != PHOBOS_NOLINK)
{
- /* Default to static linking. */
- if (phobos_library != PHOBOS_DYNAMIC)
- phobos_library = PHOBOS_STATIC;
+ /* Default to dynamic linking. */
+ if (phobos_library != PHOBOS_STATIC)
+ phobos_library = PHOBOS_DYNAMIC;
#ifdef HAVE_LD_STATIC_DYNAMIC
if (phobos_library == PHOBOS_STATIC && !static_link)

17
debian/patches/gdc-multiarch.diff vendored Normal file
View File

@@ -0,0 +1,17 @@
# DP: Set the D target include directory to a multiarch location.
--- a/src/gcc/d/Make-lang.in
+++ b/src/gcc/d/Make-lang.in
@@ -61,7 +61,11 @@
$(D_DMD_H)
-gcc_d_target_include_dir=$(gcc_d_include_dir)/$(target_noncanonical)
+ifneq (,$(MULTIARCH_DIRNAME))
+ gcc_d_target_include_dir = /usr/include/$(MULTIARCH_DIRNAME)/d/$(version)
+else
+ gcc_d_target_include_dir=$(gcc_d_include_dir)/$(target_noncanonical)
+endif
# Name of phobos library
D_LIBPHOBOS = -DLIBPHOBOS=\"gphobos2\"

53
debian/patches/gdc-texinfo.diff vendored Normal file
View File

@@ -0,0 +1,53 @@
# DP: Add macros for the gdc texinfo documentation.
--- a/src/gcc/d/gdc.texi
+++ b/src/gcc/d/gdc.texi
@@ -45,6 +45,22 @@ man page gfdl(7).
@insertcopying
@end ifinfo
+@macro versionsubtitle
+@ifclear DEVELOPMENT
+@subtitle For @sc{gcc} version @value{version-GCC}
+@end ifclear
+@ifset DEVELOPMENT
+@subtitle For @sc{gcc} version @value{version-GCC} (pre-release)
+@end ifset
+@ifset VERSION_PACKAGE
+@sp 1
+@subtitle @value{VERSION_PACKAGE}
+@end ifset
+@c Even if there are no authors, the second titlepage line should be
+@c forced to the bottom of the page.
+@vskip 0pt plus 1filll
+@end macro
+
@titlepage
@title The GNU D Compiler
@versionsubtitle
@@ -123,6 +139,25 @@ This manual only documents the options s
* Developer Options:: Options useful for developers of gdc
@end menu
+@macro gcctabopt{body}
+@code{\body\}
+@end macro
+@macro gccoptlist{body}
+@smallexample
+\body\
+@end smallexample
+@end macro
+@c Makeinfo handles the above macro OK, TeX needs manual line breaks;
+@c they get lost at some point in handling the macro. But if @macro is
+@c used here rather than @alias, it produces double line breaks.
+@iftex
+@alias gol = *
+@end iftex
+@ifnottex
+@macro gol
+@end macro
+@end ifnottex
+
@c man begin OPTIONS
@node Input and Output files

95
debian/patches/git-doc-updates.diff vendored Normal file
View File

@@ -0,0 +1,95 @@
# DP: updates from the 14 branch upto 20250810 (documentation).
LANG=C git diff --no-renames --src-prefix=a/src/ --dst-prefix=b/src/ \
c9cd41fba9ebd288c4f101e4b99da934bcb96a11 959349ffd61a27c7d881374b682389a8d9d78a9d \
| awk '/^diff .*\.texi/ {skip=0; print; next} /^diff / {skip=1; next} skip==0' \
| grep -v -E '^(diff|index)'
--- a/src/gcc/doc/avr-mmcu.texi
+++ b/src/gcc/doc/avr-mmcu.texi
@@ -50,15 +50,15 @@
@item @anchor{avrxmega2}avrxmega2
``XMEGA'' devices with more than 8@tie{}KiB and up to 64@tie{}KiB of program memory.
-@*@var{mcu}@tie{}= @code{atxmega8e5}, @code{atxmega16a4}, @code{atxmega16a4u}, @code{atxmega16c4}, @code{atxmega16d4}, @code{atxmega16e5}, @code{atxmega32a4}, @code{atxmega32a4u}, @code{atxmega32c3}, @code{atxmega32c4}, @code{atxmega32d3}, @code{atxmega32d4}, @code{atxmega32e5}, @code{avr64da28}, @code{avr64da32}, @code{avr64da48}, @code{avr64da64}, @code{avr64db28}, @code{avr64db32}, @code{avr64db48}, @code{avr64db64}, @code{avr64dd14}, @code{avr64dd20}, @code{avr64dd28}, @code{avr64dd32}, @code{avr64du28}, @code{avr64du32}, @code{avr64ea28}, @code{avr64ea32}, @code{avr64ea48}, @code{avr64sd28}, @code{avr64sd32}, @code{avr64sd48}.
+@*@var{mcu}@tie{}= @code{atxmega8e5}, @code{atxmega16a4}, @code{atxmega16a4u}, @code{atxmega16c4}, @code{atxmega16d4}, @code{atxmega16e5}, @code{atxmega32a4}, @code{atxmega32a4u}, @code{atxmega32c3}, @code{atxmega32c4}, @code{atxmega32d3}, @code{atxmega32d4}, @code{atxmega32e5}, @code{avr64da28}, @code{avr64da28s}, @code{avr64da32}, @code{avr64da32s}, @code{avr64da48}, @code{avr64da48s}, @code{avr64da64}, @code{avr64da64s}, @code{avr64db28}, @code{avr64db32}, @code{avr64db48}, @code{avr64db64}, @code{avr64dd14}, @code{avr64dd20}, @code{avr64dd28}, @code{avr64dd32}, @code{avr64du28}, @code{avr64du32}, @code{avr64ea28}, @code{avr64ea32}, @code{avr64ea48}, @code{avr64sd28}, @code{avr64sd32}, @code{avr64sd48}.
@item @anchor{avrxmega3}avrxmega3
``XMEGA'' devices with up to 64@tie{}KiB of combined program memory and RAM, and with program memory visible in the RAM address space.
-@*@var{mcu}@tie{}= @code{attiny202}, @code{attiny204}, @code{attiny212}, @code{attiny214}, @code{attiny402}, @code{attiny404}, @code{attiny406}, @code{attiny412}, @code{attiny414}, @code{attiny416}, @code{attiny416auto}, @code{attiny417}, @code{attiny424}, @code{attiny426}, @code{attiny427}, @code{attiny804}, @code{attiny806}, @code{attiny807}, @code{attiny814}, @code{attiny816}, @code{attiny817}, @code{attiny824}, @code{attiny826}, @code{attiny827}, @code{attiny1604}, @code{attiny1606}, @code{attiny1607}, @code{attiny1614}, @code{attiny1616}, @code{attiny1617}, @code{attiny1624}, @code{attiny1626}, @code{attiny1627}, @code{attiny3214}, @code{attiny3216}, @code{attiny3217}, @code{attiny3224}, @code{attiny3226}, @code{attiny3227}, @code{atmega808}, @code{atmega809}, @code{atmega1608}, @code{atmega1609}, @code{atmega3208}, @code{atmega3209}, @code{atmega4808}, @code{atmega4809}, @code{avr16dd14}, @code{avr16dd20}, @code{avr16dd28}, @code{avr16dd32}, @code{avr16du14}, @code{avr16du20}, @code{avr16du28}, @code{avr16du32}, @code{avr16ea28}, @code{avr16ea32}, @code{avr16ea48}, @code{avr16eb14}, @code{avr16eb20}, @code{avr16eb28}, @code{avr16eb32}, @code{avr32da28}, @code{avr32da32}, @code{avr32da48}, @code{avr32db28}, @code{avr32db32}, @code{avr32db48}, @code{avr32dd14}, @code{avr32dd20}, @code{avr32dd28}, @code{avr32dd32}, @code{avr32du14}, @code{avr32du20}, @code{avr32du28}, @code{avr32du32}, @code{avr32ea28}, @code{avr32ea32}, @code{avr32ea48}, @code{avr32sd20}, @code{avr32sd28}, @code{avr32sd32}.
+@*@var{mcu}@tie{}= @code{attiny202}, @code{attiny204}, @code{attiny212}, @code{attiny214}, @code{attiny402}, @code{attiny404}, @code{attiny406}, @code{attiny412}, @code{attiny414}, @code{attiny416}, @code{attiny416auto}, @code{attiny417}, @code{attiny424}, @code{attiny426}, @code{attiny427}, @code{attiny804}, @code{attiny806}, @code{attiny807}, @code{attiny814}, @code{attiny816}, @code{attiny817}, @code{attiny824}, @code{attiny826}, @code{attiny827}, @code{attiny1604}, @code{attiny1606}, @code{attiny1607}, @code{attiny1614}, @code{attiny1616}, @code{attiny1617}, @code{attiny1624}, @code{attiny1626}, @code{attiny1627}, @code{attiny3214}, @code{attiny3216}, @code{attiny3217}, @code{attiny3224}, @code{attiny3226}, @code{attiny3227}, @code{atmega808}, @code{atmega809}, @code{atmega1608}, @code{atmega1609}, @code{atmega3208}, @code{atmega3209}, @code{atmega4808}, @code{atmega4809}, @code{avr16dd14}, @code{avr16dd20}, @code{avr16dd28}, @code{avr16dd32}, @code{avr16du14}, @code{avr16du20}, @code{avr16du28}, @code{avr16du32}, @code{avr16ea28}, @code{avr16ea32}, @code{avr16ea48}, @code{avr16eb14}, @code{avr16eb20}, @code{avr16eb28}, @code{avr16eb32}, @code{avr32da28}, @code{avr32da28s}, @code{avr32da32}, @code{avr32da32s}, @code{avr32da48}, @code{avr32da48s}, @code{avr32db28}, @code{avr32db32}, @code{avr32db48}, @code{avr32dd14}, @code{avr32dd20}, @code{avr32dd28}, @code{avr32dd32}, @code{avr32du14}, @code{avr32du20}, @code{avr32du28}, @code{avr32du32}, @code{avr32ea28}, @code{avr32ea32}, @code{avr32ea48}, @code{avr32sd20}, @code{avr32sd28}, @code{avr32sd32}.
@item @anchor{avrxmega4}avrxmega4
``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB of program memory.
-@*@var{mcu}@tie{}= @code{atxmega64a3}, @code{atxmega64a3u}, @code{atxmega64a4u}, @code{atxmega64b1}, @code{atxmega64b3}, @code{atxmega64c3}, @code{atxmega64d3}, @code{atxmega64d4}, @code{avr128da28}, @code{avr128da32}, @code{avr128da48}, @code{avr128da64}, @code{avr128db28}, @code{avr128db32}, @code{avr128db48}, @code{avr128db64}.
+@*@var{mcu}@tie{}= @code{atxmega64a3}, @code{atxmega64a3u}, @code{atxmega64a4u}, @code{atxmega64b1}, @code{atxmega64b3}, @code{atxmega64c3}, @code{atxmega64d3}, @code{atxmega64d4}, @code{avr128da28}, @code{avr128da28s}, @code{avr128da32}, @code{avr128da32s}, @code{avr128da48}, @code{avr128da48s}, @code{avr128da64}, @code{avr128da64s}, @code{avr128db28}, @code{avr128db32}, @code{avr128db48}, @code{avr128db64}.
@item @anchor{avrxmega5}avrxmega5
``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB of program memory and more than 64@tie{}KiB of RAM.
--- a/src/gcc/doc/invoke.texi
+++ b/src/gcc/doc/invoke.texi
@@ -34514,37 +34514,36 @@ VPCLMULQDQ, AVX512BITALG, RDPID and AVX512VPOPCNTDQ instruction set support.
Intel Alder Lake/Raptor Lake/Meteor Lake/Gracemont CPU with 64-bit extensions,
MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW,
PCLMUL, RDRND, XSAVE, XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX,
-GFNI-SSE, CLWB, MOVDIRI, MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI,
-BMI2, F16C, FMA, LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL,
-WIDEKL and AVX-VNNI instruction set support.
+GFNI-SSE, CLWB, MOVDIRI, MOVDIR64B, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C,
+FMA, LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL and
+AVX-VNNI instruction set support.
@item arrowlake
Intel Arrow Lake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC,
XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, CLWB, MOVDIRI,
-MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, LZCNT,
-PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI,
-UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT and CMPCCXADD instruction set
-support.
+MOVDIR64B, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, LZCNT, PCONFIG, PKU,
+VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI, UINTR, AVXIFMA,
+AVXVNNIINT8, AVXNECONVERT and CMPCCXADD instruction set support.
@item arrowlake-s
@itemx lunarlake
Intel Arrow Lake S/Lunar Lake CPU with 64-bit extensions, MOVBE, MMX, SSE,
SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND,
XSAVE, XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, CLWB,
-MOVDIRI, MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA,
-LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI,
-UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512,
-SM3 and SM4 instruction set support.
+MOVDIRI, MOVDIR64B, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, LZCNT,
+PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI, UINTR,
+AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, SM3 and
+SM4 instruction set support.
@item pantherlake
Intel Panther Lake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE, XSAVEC,
XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, CLWB, MOVDIRI,
-MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, LZCNT,
-PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI,
-UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512,
-SM3, SM4 and PREFETCHI instruction set support.
+MOVDIR64B, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA, LZCNT, PCONFIG, PKU,
+VAES, VPCLMULQDQ, SERIALIZE, HRESET, AVX-VNNI, UINTR, AVXIFMA, AVXVNNIINT8,
+AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, SM3, SM4 and PREFETCHI
+instruction set support.
@item sapphirerapids
@itemx emeraldrapids
@@ -34633,9 +34632,9 @@ Intel Clearwater Forest CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE,
XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, CLWB,
MOVDIRI, MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA,
-LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI,
-ENQCMD, UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16,
-SHA512, SM3, SM4, USER_MSR and PREFETCHI instruction set support.
+LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, AVX-VNNI, ENQCMD,
+UINTR, AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512,
+SM3, SM4, USER_MSR and PREFETCHI instruction set support.
@item knl
Intel Knights Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,

5858
debian/patches/git-updates.diff vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
# DP: ignore gm2version.o stage diff on some archtectures (m68k, riscv64)
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -3678,6 +3678,7 @@ AC_SUBST(stage2_werror_flag)
compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
compare_exclusions="$compare_exclusions | gcc/m2/gm2-compiler-boot/M2Version*"
compare_exclusions="$compare_exclusions | gcc/m2/gm2-compiler-boot/SYSTEM*"
+compare_exclusions="$compare_exclusions | *m2/gm2version\$(objext)"
case "$target" in
hppa*64*-*-hpux*) ;;
hppa*-*-hpux*) compare_exclusions="$compare_exclusions | */libgcc/lib2funcs* | gcc/function-tests.o" ;;

30
debian/patches/gm2-texinfo.diff vendored Normal file
View File

@@ -0,0 +1,30 @@
# DP: gm2.texi: Define our own gcctabopt macro, needed for dfsg builds.
--- a/src/gcc/doc/gm2.texi
+++ b/src/gcc/doc/gm2.texi
@@ -51,6 +51,25 @@ man page gfdl(7).
@versionsubtitle
@author Gaius Mulley
+@macro gcctabopt{body}
+@code{\body\}
+@end macro
+@macro gccoptlist{body}
+@smallexample
+\body\
+@end smallexample
+@end macro
+@c Makeinfo handles the above macro OK, TeX needs manual line breaks;
+@c they get lost at some point in handling the macro. But if @macro is
+@c used here rather than @alias, it produces double line breaks.
+@iftex
+@alias gol = *
+@end iftex
+@ifnottex
+@macro gol
+@end macro
+@end ifnottex
+
@page
@vskip 0pt plus 1filll
Published by the Free Software Foundation @*

19
debian/patches/go-testsuite.diff vendored Normal file
View File

@@ -0,0 +1,19 @@
# DP: Skip Go testcase on AArch64 which hangs on the buildds.
--- a/src/gcc/testsuite/go.test/go-test.exp
+++ b/src/gcc/testsuite/go.test/go-test.exp
@@ -460,6 +460,14 @@ proc go-gc-tests { } {
continue
}
+ # Hangs on the buildds
+ if { [istarget "aarch64*-*-*"] } {
+ if { [file tail $test] == "pprof.go" } {
+ untested $test
+ continue
+ }
+ }
+
if { [file tail $test] == "init1.go" } {
# This tests whether GC runs during init, which for gccgo
# it currently does not.

View File

@@ -0,0 +1,15 @@
--- a/src/libgcc/libgcov.h
+++ b/src/libgcc/libgcov.h
@@ -45,6 +45,12 @@
#include "libgcc_tm.h"
#include "gcov.h"
+/* hppa64-linux-gnu does not have this header, use the fallback. */
+#if defined(__LP64__) && defined(_PA_RISC2_0)
+#undef HAVE_SYS_MMAN_H
+#define HAVE_SYS_MMAN_H 0
+#endif
+
#if HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif

20
debian/patches/hurd-changes.diff vendored Normal file
View File

@@ -0,0 +1,20 @@
# DP: Traditional GNU systems don't have a /usr directory. However, Debian
# DP: systems do, and we support both having a /usr -> . symlink, and having a
# DP: /usr directory like the other ports. So this patch should NOT go
# DP: upstream.
---
config.gcc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/gcc/config.gcc
+++ b/src/gcc/config.gcc
@@ -583,7 +583,7 @@
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-kopensolaris*-gnu)
:;;
*-*-gnu*)
- native_system_header_dir=/include
+ # native_system_header_dir=/include
;;
esac
# glibc / uclibc / bionic switch.

16
debian/patches/hurd-multiarch.diff vendored Normal file
View File

@@ -0,0 +1,16 @@
--- a/src/gcc/config/i386/t-gnu64
+++ b/src/gcc/config/i386/t-gnu64
@@ -36,3 +36,13 @@ MULTILIB_DIRNAMES = $(patsubst m%, %,
MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-gnu)
MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-gnu)
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-gnux32)
+
+ifneq (,$(findstring x86_64,$(target)))
+ ifneq (,$(findstring biarchx32.h,$(tm_include_list)))
+ MULTIARCH_DIRNAME = $(call if_multiarch,x86_64-gnux32)
+ else
+ MULTIARCH_DIRNAME = $(call if_multiarch,x86_64-gnu)
+ endif
+else
+ MULTIARCH_DIRNAME = $(call if_multiarch,i386-gnu)
+endif

View File

@@ -0,0 +1,23 @@
--- a/src/gcc/config/i386/t-gnu64
+++ b/src/gcc/config/i386/t-gnu64
@@ -33,9 +33,19 @@
comma=,
MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+ifneq (,$(findstring gnux32,$(target)))
MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-gnu)
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-gnu)
+MULTILIB_OSDIRNAMES+= m32=../lib32$(call if_multiarch,:i386-gnu)
+MULTILIB_OSDIRNAMES+= mx32=../lib$(call if_multiarch,:x86_64-gnux32)
+else ifneq (,$(findstring x86_64,$(target)))
+MULTILIB_OSDIRNAMES = m64=../lib$(call if_multiarch,:x86_64-gnu)
+MULTILIB_OSDIRNAMES+= m32=../lib32$(call if_multiarch,:i386-gnu)
MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-gnux32)
+else
+MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-gnu)
+MULTILIB_OSDIRNAMES+= m32=../lib$(call if_multiarch,:i386-gnu)
+MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-gnux32)
+endif
ifneq (,$(findstring x86_64,$(target)))
ifneq (,$(findstring biarchx32.h,$(tm_include_list)))

View File

@@ -0,0 +1,16 @@
--- a/src/gcc/config/ia64/ia64.cc
+++ b/src/gcc/config/ia64/ia64.cc
@@ -6130,13 +6130,6 @@ ia64_option_override (void)
static void
ia64_override_options_after_change (void)
{
- if (optimize >= 3
- && !OPTION_SET_P (flag_selective_scheduling)
- && !OPTION_SET_P (flag_selective_scheduling2))
- {
- flag_selective_scheduling2 = 1;
- flag_sel_sched_pipelining = 1;
- }
if (mflag_sched_control_spec == 2)
{
/* Control speculation is on by default for the selective scheduler,

View File

@@ -0,0 +1,56 @@
# DP: Ignore dpkg's pie specs when pie is not enabled.
Index: b/src/gcc/gcc.c
===================================================================
--- a/src/gcc/gcc.c
+++ b/src/gcc/gcc.c
@@ -3715,6 +3715,36 @@ handle_foffload_option (const char *arg)
}
}
+static bool ignore_pie_specs_when_not_enabled(const char *envvar,
+ const char *specname)
+{
+ const char *envval = secure_getenv(envvar);
+ char *hardening;
+ bool ignore;
+
+ if (strstr (specname, "/pie-compile.specs") == NULL
+ && strstr (specname, "/pie-link.specs") == NULL)
+ return false;
+ if (envval == NULL || strstr (envval, "hardening=") == NULL)
+ return true;
+ ignore = true;
+ hardening = (char *) xmalloc (strlen(envval) + 1);
+ strcpy (hardening, strstr (envval, "hardening="));
+ if (strchr (hardening, ' '))
+ *strchr (hardening, ' ') = '\0';
+ if (strstr(hardening, "+all"))
+ {
+ if (strstr(hardening, "-pie") == NULL)
+ ignore = false;
+ }
+ else if (strstr(hardening, "+pie"))
+ {
+ ignore = false;
+ }
+ free (hardening);
+ return ignore;
+}
+
/* Handle a driver option; arguments and return value as for
handle_option. */
@@ -3989,6 +4019,12 @@ driver_handle_option (struct gcc_options
break;
case OPT_specs_:
+ if (ignore_pie_specs_when_not_enabled("DEB_BUILD_MAINT_OPTIONS", arg)
+ && ignore_pie_specs_when_not_enabled("DEB_BUILD_OPTIONS", arg))
+ {
+ inform (0, "pie specs %s ignored when pie is not enabled", arg);
+ return true;
+ }
{
struct user_specs *user = XNEW (struct user_specs);

163
debian/patches/libasan-sparc.diff vendored Normal file
View File

@@ -0,0 +1,163 @@
# DP: Re-apply sanitizer patch for sparc, dropped upstream
# don't remove, this is regularly overwritten, see PR sanitizer/63958.
libsanitizer/
2014-10-14 David S. Miller <davem@davemloft.net>
* sanitizer_common/sanitizer_platform_limits_linux.cc (time_t):
Define at __kernel_time_t, as needed for sparc.
(struct __old_kernel_stat): Don't check if __sparc__ is defined.
* libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
(__sanitizer): Define struct___old_kernel_stat_sz,
struct_kernel_stat_sz, and struct_kernel_stat64_sz for sparc.
(__sanitizer_ipc_perm): Adjust for sparc targets.
(__sanitizer_shmid_ds): Likewsie.
(__sanitizer_sigaction): Likewsie.
(IOC_SIZE): Likewsie.
Index: libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
===================================================================
--- a/src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h (revision 216223)
+++ a/src/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h (revision 216224)
@@ -72,6 +72,14 @@
const unsigned struct_kernel_stat_sz = 144;
#endif
const unsigned struct_kernel_stat64_sz = 104;
+#elif defined(__sparc__) && defined(__arch64__)
+ const unsigned struct___old_kernel_stat_sz = 0;
+ const unsigned struct_kernel_stat_sz = 104;
+ const unsigned struct_kernel_stat64_sz = 144;
+#elif defined(__sparc__) && !defined(__arch64__)
+ const unsigned struct___old_kernel_stat_sz = 0;
+ const unsigned struct_kernel_stat_sz = 64;
+ const unsigned struct_kernel_stat64_sz = 104;
#endif
struct __sanitizer_perf_event_attr {
unsigned type;
@@ -94,7 +102,7 @@
#if defined(__powerpc64__)
const unsigned struct___old_kernel_stat_sz = 0;
-#else
+#elif !defined(__sparc__)
const unsigned struct___old_kernel_stat_sz = 32;
#endif
@@ -173,6 +181,18 @@
unsigned short __pad1;
unsigned long __unused1;
unsigned long __unused2;
+#elif defined(__sparc__)
+# if defined(__arch64__)
+ unsigned mode;
+ unsigned short __pad1;
+# else
+ unsigned short __pad1;
+ unsigned short mode;
+ unsigned short __pad2;
+# endif
+ unsigned short __seq;
+ unsigned long long __unused1;
+ unsigned long long __unused2;
#else
unsigned short mode;
unsigned short __pad1;
@@ -190,6 +210,26 @@
struct __sanitizer_shmid_ds {
__sanitizer_ipc_perm shm_perm;
+ #if defined(__sparc__)
+ # if !defined(__arch64__)
+ u32 __pad1;
+ # endif
+ long shm_atime;
+ # if !defined(__arch64__)
+ u32 __pad2;
+ # endif
+ long shm_dtime;
+ # if !defined(__arch64__)
+ u32 __pad3;
+ # endif
+ long shm_ctime;
+ uptr shm_segsz;
+ int shm_cpid;
+ int shm_lpid;
+ unsigned long shm_nattch;
+ unsigned long __glibc_reserved1;
+ unsigned long __glibc_reserved2;
+ #else
#ifndef __powerpc__
uptr shm_segsz;
#elif !defined(__powerpc64__)
@@ -227,6 +267,7 @@
uptr __unused4;
uptr __unused5;
#endif
+#endif
};
#elif SANITIZER_FREEBSD
struct __sanitizer_ipc_perm {
@@ -523,9 +564,13 @@
#else
__sanitizer_sigset_t sa_mask;
#ifndef __mips__
+#if defined(__sparc__)
+ unsigned long sa_flags;
+#else
int sa_flags;
#endif
#endif
+#endif
#if SANITIZER_LINUX
void (*sa_restorer)();
#endif
@@ -745,7 +790,7 @@
#define IOC_NRBITS 8
#define IOC_TYPEBITS 8
-#if defined(__powerpc__) || defined(__powerpc64__) || defined(__mips__)
+#if defined(__powerpc__) || defined(__powerpc64__) || defined(__mips__) || defined(__sparc__)
#define IOC_SIZEBITS 13
#define IOC_DIRBITS 3
#define IOC_NONE 1U
@@ -775,7 +820,17 @@
#define IOC_DIR(nr) (((nr) >> IOC_DIRSHIFT) & IOC_DIRMASK)
#define IOC_TYPE(nr) (((nr) >> IOC_TYPESHIFT) & IOC_TYPEMASK)
#define IOC_NR(nr) (((nr) >> IOC_NRSHIFT) & IOC_NRMASK)
+
+#if defined(__sparc__)
+// In sparc the 14 bits SIZE field overlaps with the
+// least significant bit of DIR, so either IOC_READ or
+// IOC_WRITE shall be 1 in order to get a non-zero SIZE.
+# define IOC_SIZE(nr) \
+ ((((((nr) >> 29) & 0x7) & (4U|2U)) == 0)? \
+ 0 : (((nr) >> 16) & 0x3fff))
+#else
#define IOC_SIZE(nr) (((nr) >> IOC_SIZESHIFT) & IOC_SIZEMASK)
+#endif
extern unsigned struct_arpreq_sz;
extern unsigned struct_ifreq_sz;
Index: libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc
===================================================================
--- a/src/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc (revision 216223)
+++ a/src/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc (revision 216224)
@@ -36,6 +36,7 @@
#define uid_t __kernel_uid_t
#define gid_t __kernel_gid_t
#define off_t __kernel_off_t
+#define time_t __kernel_time_t
// This header seems to contain the definitions of _kernel_ stat* structs.
#include <asm/stat.h>
#undef ino_t
@@ -60,7 +61,7 @@
} // namespace __sanitizer
#if !defined(__powerpc64__) && !defined(__x86_64__) && !defined(__aarch64__)\
- && !defined(__mips__)
+ && !defined(__mips__) && !defined(__sparc__)
COMPILER_CHECK(struct___old_kernel_stat_sz == sizeof(struct __old_kernel_stat));
#endif

View File

@@ -0,0 +1,33 @@
From 48d2e46528fb6e621d95a7fa194069fd136b712d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20B=C3=BChler?= <buehler@cert.uni-stuttgart.de>
Date: Wed, 7 Sep 2016 15:49:48 +0200
Subject: [PATCH 1/2] dlmmap_locked always needs locking as it always modifies
execsize
---
src/closures.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
--- a/src/libffi/src/closures.c
+++ b/src/libffi/src/closures.c
@@ -897,16 +897,11 @@ dlmmap (void *start, size_t length, int
MREMAP_DUP and prot at this point. */
}
- if (execsize == 0 || execfd == -1)
- {
- pthread_mutex_lock (&open_temp_exec_file_mutex);
- ptr = dlmmap_locked (start, length, prot, flags, offset);
- pthread_mutex_unlock (&open_temp_exec_file_mutex);
+ pthread_mutex_lock (&open_temp_exec_file_mutex);
+ ptr = dlmmap_locked (start, length, prot, flags, offset);
+ pthread_mutex_unlock (&open_temp_exec_file_mutex);
- return ptr;
- }
-
- return dlmmap_locked (start, length, prot, flags, offset);
+ return ptr;
}
/* Release memory at the given address, as well as the corresponding

View File

@@ -0,0 +1,13 @@
# DP: PR libffi/47248, force a read only eh frame section.
--- a/src/libffi/configure.ac
+++ b/src/libffi/configure.ac
@@ -296,6 +296,8 @@ if test "x$GCC" = "xyes"; then
libffi_cv_hidden_visibility_attribute=yes
fi
fi
+ # FIXME: see PR libffi/47248
+ libffi_cv_ro_eh_frame=yes
rm -f conftest.*
])
if test $libffi_cv_hidden_visibility_attribute = yes; then

26
debian/patches/libgo-cleanfiles.diff vendored Normal file
View File

@@ -0,0 +1,26 @@
--- a/src/libgo/Makefile.am
+++ b/src/libgo/Makefile.am
@@ -1369,7 +1369,9 @@ mostlyclean-local:
find . -name '*-testsum' -print | xargs rm -f
find . -name '*-testlog' -print | xargs rm -f
-CLEANFILES = *.go *.c s-* libgo.sum libgo.log runtime.inc
+CLEANFILES = *.go *.c s-* libgo.sum libgo.log runtime.inc \
+ *.dep */*.dep */*/*.dep */*/*/*.dep */*/*.dep */*/*/*/*.dep \
+ */*/*/*/*/*.dep
clean-local:
find . -name '*.la' -print | xargs $(LIBTOOL) --mode=clean rm -f
--- a/src/libgo/Makefile.in
+++ b/src/libgo/Makefile.in
@@ -1207,7 +1207,9 @@ MOSTLYCLEANFILES = \
libcalls-list \
runtime.inc runtime.inc.tmp2 runtime.inc.tmp3 runtime.inc.raw
-CLEANFILES = *.go *.c s-* libgo.sum libgo.log runtime.inc
+CLEANFILES = *.go *.c s-* libgo.sum libgo.log runtime.inc \
+ *.dep */*.dep */*/*.dep */*/*/*.dep */*/*.dep */*/*/*/*.dep \
+ */*/*/*/*/*.dep
MULTISRCTOP =
MULTIBUILDTOP =
MULTIDIRS =

22
debian/patches/libgo-hurd-hack.diff vendored Normal file
View File

@@ -0,0 +1,22 @@
# FIXME: #1005297, PR 104660
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -67372,6 +67372,8 @@ all-flex: maybe-all-build-texinfo
all-m4: maybe-all-build-texinfo
configure-target-libgo: maybe-configure-target-libffi
all-target-libgo: maybe-all-target-libffi
+all-target-libgo: maybe-all-target-libbacktrace
+all-target-libgo: maybe-all-target-libatomic
configure-target-libphobos: maybe-configure-target-libbacktrace
configure-stage1-target-libphobos: maybe-configure-stage1-target-libbacktrace
configure-stage2-target-libphobos: maybe-configure-stage2-target-libbacktrace
@@ -67539,8 +67541,6 @@ all-m4: maybe-all-intl
configure-target-fastjar: maybe-configure-target-zlib
all-target-fastjar: maybe-all-target-zlib
configure-target-libgo: maybe-all-target-libstdc++-v3
-all-target-libgo: maybe-all-target-libbacktrace
-all-target-libgo: maybe-all-target-libatomic
configure-target-libgm2: maybe-all-target-libstdc++-v3
all-target-libgm2: maybe-all-target-libatomic
configure-target-liboffloadmic: maybe-configure-target-libgomp

47
debian/patches/libgo-hurd-syscall.diff vendored Normal file
View File

@@ -0,0 +1,47 @@
commit aad9de322774c25e80f3ade6ecd96f45b62bf40a
Author: Ian Lance Taylor <iant@golang.org>
Date: Tue Oct 29 15:39:02 2024 -0700
syscall: don't define syscall stub on Hurd
Patch from Samuel Thibault.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/623415
--- a/src/libgo/go/syscall/syscall_funcs.go
+++ b/src/libgo/go/syscall/syscall_funcs.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
-// +build darwin dragonfly freebsd hurd linux netbsd openbsd solaris
+//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
+// +build darwin dragonfly freebsd linux netbsd openbsd solaris
package syscall
--- a/src/libgo/go/syscall/syscall_funcs_stubs.go
+++ b/src/libgo/go/syscall/syscall_funcs_stubs.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build aix || rtems
-// +build aix rtems
+//go:build aix || hurd || rtems
+// +build aix hurd rtems
// These are stubs.
--- a/src/libgo/runtime/go-nosys.c
+++ b/src/libgo/runtime/go-nosys.c
@@ -504,7 +504,7 @@ strerror_r (int errnum, char *buf, size_
#endif /* ! HAVE_STRERROR_R */
-#ifndef HAVE_SYSCALL
+#if !defined(HAVE_SYSCALL) && !defined(__GNU__) /* GNU/Hurd already has a stub */
int
syscall(int number __attribute__ ((unused)), ...)
{

View File

@@ -0,0 +1,10 @@
--- a/src/libgo/testsuite/lib/libgo.exp
+++ b/src/libgo/testsuite/lib/libgo.exp
@@ -49,7 +49,6 @@ load_gcc_lib wrapper.exp
load_gcc_lib target-supports.exp
load_gcc_lib target-utils.exp
load_gcc_lib gcc-defs.exp
-load_gcc_lib timeout.exp
load_gcc_lib go.exp
proc libgo_init { args } {

View File

@@ -0,0 +1,19 @@
# DP: libgo: Overwrite the setcontext_clobbers_tls check on mips*
--- a/src/libgo/configure.ac
+++ b/src/libgo/configure.ac
@@ -802,6 +802,14 @@ main ()
CFLAGS="$CFLAGS_hold"
LIBS="$LIBS_hold"
])
+dnl overwrite for the mips* 64bit multilibs, fails on some buildds
+if test "$libgo_cv_lib_setcontext_clobbers_tls" = "yes"; then
+ case "$target" in
+ mips*-linux-*)
+ AC_MSG_WARN([FIXME: overwrite setcontext_clobbers_tls for $target:$ptr_type_size])
+ libgo_cv_lib_setcontext_clobbers_tls=no ;;
+ esac
+fi
if test "$libgo_cv_lib_setcontext_clobbers_tls" = "yes"; then
AC_DEFINE(SETCONTEXT_CLOBBERS_TLS, 1,
[Define if setcontext clobbers TLS variables])

76
debian/patches/libgo-testsuite.diff vendored Normal file
View File

@@ -0,0 +1,76 @@
# DP: Only run the libgo testsuite for flags configured in CHECK_MULTISUBDIRS
--- a/src/libgo/Makefile.am
+++ b/src/libgo/Makefile.am
@@ -947,21 +947,29 @@ CHECK = \
$(MKDIR_P) $(@D); \
rm -f $@-testsum $@-testlog; \
files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst .,_,$(subst /,_,$(@D))))" $(matchargs_$(subst /,_,$(@D)))`; \
+ run_check=; \
+ if [ -z "$(MULTISUBDIR)" ] || echo "$$CHECK_MULTISUBDIRS" | grep -q "$(MULTISUBDIR)"; then \
+ run_check=yes; \
+ fi; \
+ if test "$$run_check" = "yes"; then \
if test "$(USE_DEJAGNU)" = "yes"; then \
$(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
elif test "$(GOBENCH)" != ""; then \
$(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
else \
if $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \
- echo "PASS: $(@D)" >> $@-testlog; \
- echo "PASS: $(@D)"; \
- echo "PASS: $(@D)" > $@-testsum; \
+ echo "PASS: $(@D)$(MULTISUBDIR)" >> $@-testlog; \
+ echo "PASS: $(@D)$(MULTISUBDIR)"; \
+ echo "PASS: $(@D)$(MULTISUBDIR)" > $@-testsum; \
else \
- echo "FAIL: $(@D)" >> $@-testlog; \
+ echo "FAIL: $(@D)$(MULTISUBDIR)" >> $@-testlog; \
cat $@-testlog; \
- echo "FAIL: $(@D)" > $@-testsum; \
+ echo "FAIL: $(@D)$(MULTISUBDIR)" > $@-testsum; \
exit 1; \
fi; \
+ fi; \
+ else \
+ echo "SKIP: $(@D)$(MULTISUBDIR)"; \
fi
# Build all packages before checking any.
--- a/src/libgo/Makefile.in
+++ b/src/libgo/Makefile.in
@@ -1065,21 +1065,29 @@ CHECK = \
$(MKDIR_P) $(@D); \
rm -f $@-testsum $@-testlog; \
files=`$(SHELL) $(srcdir)/match.sh --goarch=$(GOARCH) --goos=$(GOOS) --srcdir=$(srcdir)/go/$(@D) --extrafiles="$(extra_go_files_$(subst .,_,$(subst /,_,$(@D))))" $(matchargs_$(subst /,_,$(@D)))`; \
+ run_check=; \
+ if [ -z "$(MULTISUBDIR)" ] || echo "$$CHECK_MULTISUBDIRS" | grep -q "$(MULTISUBDIR)"; then \
+ run_check=yes; \
+ fi; \
+ if test "$$run_check" = "yes"; then \
if test "$(USE_DEJAGNU)" = "yes"; then \
$(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
elif test "$(GOBENCH)" != ""; then \
$(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
else \
if $(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" $(GOTESTFLAGS) >>$@-testlog 2>&1; then \
- echo "PASS: $(@D)" >> $@-testlog; \
- echo "PASS: $(@D)"; \
- echo "PASS: $(@D)" > $@-testsum; \
+ echo "PASS: $(@D)$(MULTISUBDIR)" >> $@-testlog; \
+ echo "PASS: $(@D)$(MULTISUBDIR)"; \
+ echo "PASS: $(@D)$(MULTISUBDIR)" > $@-testsum; \
else \
- echo "FAIL: $(@D)" >> $@-testlog; \
+ echo "FAIL: $(@D)$(MULTISUBDIR)" >> $@-testlog; \
cat $@-testlog; \
- echo "FAIL: $(@D)" > $@-testsum; \
+ echo "FAIL: $(@D)$(MULTISUBDIR)" > $@-testsum; \
exit 1; \
fi; \
+ fi; \
+ else \
+ echo "SKIP: $(@D)$(MULTISUBDIR)"; \
fi

View File

@@ -0,0 +1,32 @@
# DP: Fix up omp.h for multilibs.
2008-06-09 Jakub Jelinek <jakub@redhat.com>
* omp.h.in (omp_nest_lock_t): Fix up for Linux multilibs.
2015-03-25 Matthias Klose <doko@ubuntu.com>
* omp.h.in (omp_nest_lock_t): Limit the fix Linux.
--- a/src/libgomp/omp.h.in
+++ b/src/libgomp/omp.h.in
@@ -52,8 +52,19 @@ typedef struct
typedef struct
{
+ /*
+ Derive OMP_NEST_LOCK_SIZE and OMP_NEST_LOCK_ALIGN, don't hard
+ code the values because the header is used for all multilibs.
+ OMP_NEST_LOCK_SIZE = @OMP_NEST_LOCK_SIZE@
+ OMP_NEST_LOCK_ALIGN = @OMP_NEST_LOCK_ALIGN@
+ */
+#if defined(__linux__) && !(defined(__hppa__) || defined(__alpha__))
+ unsigned char _x[8 + sizeof (void *)]
+ __attribute__((__aligned__(sizeof (void *))));
+#else
unsigned char _x[@OMP_NEST_LOCK_SIZE@]
__attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@)));
+#endif
} omp_nest_lock_t;
#endif

View File

@@ -0,0 +1,17 @@
# DP: Build libitm with -U_FORTIFY_SOURCE on x86 and x86_64.
--- a/src/libitm/configure.tgt
+++ b/src/libitm/configure.tgt
@@ -124,6 +124,12 @@ EOF
;;
esac
+# FIXME: ftbfs with -D_FORTIFY_SOURCE (error: invalid use of '__builtin_va_arg_pack ())
+case "${target}" in
+ *-*-linux*)
+ XCFLAGS="${XCFLAGS} -U_FORTIFY_SOURCE"
+esac
+
# For the benefit of top-level configure, determine if the cpu is supported.
test -d ${srcdir}/config/$ARCH || UNSUPPORTED=1

13
debian/patches/libphobos-unittest.diff vendored Normal file
View File

@@ -0,0 +1,13 @@
# DP: https://github.com/dlang/phobos/pull/10586
--- a/src/libphobos/src/std/process.d
+++ b/src/libphobos/src/std/process.d
@@ -2800,7 +2800,7 @@ void kill(Pid pid, int codeOrSignal)
do { s = tryWait(pid); } while (!s.terminated);
version (Windows) assert(s.status == 123);
else version (Posix) assert(s.status == -SIGKILL);
- assertThrown!ProcessException(kill(pid));
+ assert(pid.processID == Pid.terminated);
}
@system unittest // wait() and kill() detached process

72
debian/patches/libphobos-zlib.diff vendored Normal file
View File

@@ -0,0 +1,72 @@
# DP: Build zlib in any case to have a fall back for missing libz multilibs
--- a/src/libphobos/configure.ac
+++ b/src/libphobos/configure.ac
@@ -142,6 +142,7 @@ DRUNTIME_LIBRARIES_BACKTRACE
DRUNTIME_LIBRARIES_DLOPEN
DRUNTIME_LIBRARIES_ZLIB
DRUNTIME_INSTALL_DIRECTORIES
+dnl fake change to regenerate the configure file
# Add dependencies for libgphobos.spec file
SPEC_PHOBOS_DEPS="$LIBS"
--- a/src/libphobos/m4/druntime/libraries.m4
+++ b/src/libphobos/m4/druntime/libraries.m4
@@ -52,19 +52,45 @@ AC_DEFUN([DRUNTIME_LIBRARIES_ZLIB],
[
AC_ARG_WITH(target-system-zlib,
AS_HELP_STRING([--with-target-system-zlib],
- [use installed libz (default: no)]))
+ [use installed libz (default: no)]),
+ [system_zlib=yes],[system_zlib=no])
- system_zlib=false
- AS_IF([test "x$with_target_system_zlib" = "xyes"], [
- AC_CHECK_LIB([z], [deflate], [
- system_zlib=yes
- ], [
- AC_MSG_ERROR([System zlib not found])
- ])
- ], [
- AC_MSG_CHECKING([for zlib])
- AC_MSG_RESULT([just compiled])
- ])
+ AC_MSG_CHECKING([for system zlib])
+ save_LIBS=$LIBS
+ LIBS="$LIBS -lz"
+ dnl the link test is not good enough for ARM32 multilib detection,
+ dnl first check to link, then to run
+ AC_LANG_PUSH(C)
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <zlib.h>],[gzopen("none", "rb")])],
+ [
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <zlib.h>
+ int main() {
+ gzFile file = gzopen("none", "rb");
+ return 0;
+ }
+ ]])],
+ [system_zlib_found=yes],
+ [system_zlib_found=no],
+ dnl no system zlib for cross builds ...
+ [system_zlib_found=no]
+ )
+ ],
+ [system_zlib_found=no])
+ if test x$system_zlib = xyes; then
+ if test x$system_zlib_found = xyes; then
+ AC_MSG_RESULT([found])
+ else
+ LIBS=$save_LIBS
+ AC_MSG_RESULT([not found, disabled])
+ system_zlib=no
+ fi
+ else
+ LIBS=$save_LIBS
+ AC_MSG_RESULT([not enabled])
+ fi
+ AC_LANG_POP
AM_CONDITIONAL([DRUNTIME_ZLIB_SYSTEM], [test "$with_target_system_zlib" = yes])
])

View File

@@ -0,0 +1,12 @@
# DP: Add another #undef for _TIME_BITS
--- a/src/libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp
+++ b/src/libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp
@@ -11,6 +11,7 @@
// Before Solaris 11.4, <procfs.h> doesn't work in a largefile environment.
#undef _FILE_OFFSET_BITS
+#undef _TIME_BITS
#include "sanitizer_platform.h"
#if SANITIZER_SOLARIS
# include <fcntl.h>

61
debian/patches/libstdc++-doclink.diff vendored Normal file
View File

@@ -0,0 +1,61 @@
# DP: adjust hrefs to point to the local documentation
---
libstdc++-v3/doc/doxygen/mainpage.html | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
--- a/src/libstdc++-v3/doc/doxygen/mainpage.html
+++ b/src/libstdc++-v3/doc/doxygen/mainpage.html
@@ -27,10 +27,10 @@
<p class="smallertext">Generated on @DATE@.</p>
<p>There are two types of documentation for libstdc++. One is the
- distribution documentation, which can be read online
- <a href="https://gcc.gnu.org/onlinedocs/libstdc++/index.html">here</a>
- or offline from the file doc/html/index.html in the library source
- directory.
+ distribution documentation, which can be read
+ <a href="../index.html">offline in the documentation directory</a>
+ or
+ <a href="https://gcc.gnu.org/onlinedocs/libstdc++/index.html">online</a>.
</p>
<p>The other type is the source documentation, of which this is the first page.
@@ -82,8 +82,11 @@
<h2>License, Copyright, and Other Lawyerly Verbosity</h2>
<p>The libstdc++ documentation is released under
+ these terms
+ (<a href="../manual/appendix_gpl.html">read offline</a> or
<a href="https://gcc.gnu.org/onlinedocs/libstdc++/manual/appendix_gpl.html">
- these terms</a>.
+ read online</a>.
+ ).
</p>
<p>Part of the generated documentation involved comments and notes from
SGI, who says we gotta say this:
--- a/src/libstdc++-v3/doc/html/api.html
+++ b/src/libstdc++-v3/doc/html/api.html
@@ -20,6 +20,8 @@
member functions for the library classes, finding out what is in a
particular include file, looking at inheritance diagrams, etc.
</p><p>
+<a class="link" href="user/index.html">The API documentation, rendered into HTML, can be viewed offline.</a>
+</p><p>
The API documentation, rendered into HTML, can be viewed online
<a class="link" href="http://gcc.gnu.org/onlinedocs/" target="_top">for each GCC release</a>
and
--- a/src/libstdc++-v3/doc/xml/api.xml
+++ b/src/libstdc++-v3/doc/xml/api.xml
@@ -40,6 +40,11 @@
</para>
<para>
+ <ulink url="user/index.html">The source-level documentation for this release can be viewed offline.
+ </ulink>
+</para>
+
+<para>
The API documentation, rendered into HTML, can be viewed online
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/">for each GCC release</link>
and

View File

@@ -0,0 +1,13 @@
--- a/src/libstdc++-v3/scripts/run_doxygen
+++ b/src/libstdc++-v3/scripts/run_doxygen
@@ -130,7 +130,9 @@ do_latex=false
latex_cmd=
enabled_sections=
generate_tagfile=
-DATEtext=`date '+%Y-%m-%d'`
+DATE_FMT="+%Y-%m-%d"
+SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
+DATEtext=`date -u -d "@$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u "$DATE_FMT"`
# Show how this script is called.
echo run_doxygen $*

48
debian/patches/libstdc++-hurd.diff vendored Normal file
View File

@@ -0,0 +1,48 @@
This is notably needed because in glibc 2.34, the move of pthread functions
into libc.so happened for Linux only, not GNU/Hurd.
The pthread_self() function can also always be used fine as it is on
GNU/Hurd.
libstdc++-v3/ChangeLog:
* config/os/gnu-linux/os_defines.h [!__linux__]
(_GLIBCXX_NATIVE_THREAD_ID, _GLIBCXX_GTHREAD_USE_WEAK): Do not define.
--- a/src/libstdc++-v3/config/os/gnu-linux/os_defines.h
+++ b/src/libstdc++-v3/config/os/gnu-linux/os_defines.h
@@ -60,22 +60,24 @@
# define _GLIBCXX_HAVE_FLOAT128_MATH 1
#endif
-#if __GLIBC_PREREQ(2, 27)
-// Since glibc 2.27 pthread_self() is usable without linking to libpthread.
-# define _GLIBCXX_NATIVE_THREAD_ID pthread_self()
-#else
+#ifdef __linux__
+# if __GLIBC_PREREQ(2, 27)
+// Since glibc 2.27 Linux' pthread_self() is usable without linking to libpthread.
+# define _GLIBCXX_NATIVE_THREAD_ID pthread_self()
+# else
// Before then it was in libc.so.6 but not libc.a, and always returns 0,
// which breaks the invariant this_thread::get_id() != thread::id{}.
// So only use it if we know the libpthread version is available.
// Otherwise use (__gthread_t)1 as the ID of the main (and only) thread.
-# define _GLIBCXX_NATIVE_THREAD_ID \
- (__gthread_active_p() ? __gthread_self() : (__gthread_t)1)
-#endif
+# define _GLIBCXX_NATIVE_THREAD_ID \
+ (__gthread_active_p() ? __gthread_self() : (__gthread_t)1)
+# endif
-#if __GLIBC_PREREQ(2, 34)
-// Since glibc 2.34 all pthreads functions are usable without linking to
+# if __GLIBC_PREREQ(2, 34)
+// Since glibc 2.34 all Linux pthreads functions are usable without linking to
// libpthread.
-# define _GLIBCXX_GTHREAD_USE_WEAK 0
+# define _GLIBCXX_GTHREAD_USE_WEAK 0
+# endif
#endif
#endif

63
debian/patches/libstdc++-man-3cxx.diff vendored Normal file
View File

@@ -0,0 +1,63 @@
# DP: Install libstdc++ man pages with suffix .3cxx instead of .3
--- a/src/libstdc++-v3/doc/doxygen/user.cfg.in
+++ b/src/libstdc++-v3/doc/doxygen/user.cfg.in
@@ -2142,7 +2142,7 @@ MAN_OUTPUT = man
# The default value is: .3.
# This tag requires that the tag GENERATE_MAN is set to YES.
-MAN_EXTENSION = .3
+MAN_EXTENSION = .3cxx
# The MAN_SUBDIR tag determines the name of the directory created within
# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
--- a/src/libstdc++-v3/scripts/run_doxygen
+++ b/src/libstdc++-v3/scripts/run_doxygen
@@ -262,6 +262,9 @@ fi
if $do_man; then
echo ::
echo :: Fixing up the man pages...
+mkdir -p $outdir/man/man3
+mv $outdir/man/man3cxx/* $outdir/man/man3/
+rmdir $outdir/man/man3cxx
cd $outdir/man/man3
# File names with embedded spaces (EVIL!) need to be....? renamed or removed?
@@ -291,7 +294,7 @@ cxxflags="-Og -g -std=gnu++23"
$gxx $cppflags $cxxflags ${srcdir}/doc/doxygen/stdheader.cc -o ./stdheader || exit 1
# Doxygen outputs something like "\fC#include <unique_lock\&.h>\fP" and
# we want that internal header to be replaced with something like <mutex>.
-problematic=`grep -E -l '#include <.*h>' [a-z]*.3`
+problematic=`grep -E -l '#include <.*h>' [a-z]*.3 [a-z]*.3cxx`
for f in $problematic; do
# this is also slow, but safe and easy to debug
oldh=`sed -n '/f[CR]#include </s/.*<\(.*\)>.*/\1/p' $f`
@@ -307,7 +310,7 @@ rm stdheader
# Some of the pages for generated modules have text that confuses certain
# implementations of man(1), e.g. on GNU/Linux. We need to have another
# top-level *roff tag to /stop/ the .SH NAME entry.
-problematic=`grep -E --files-without-match '^\.SH SYNOPSIS' [A-Z]*.3`
+problematic=`grep -E --files-without-match '^\.SH SYNOPSIS' [A-Z]*.3cxx`
#problematic='Containers.3 Sequences.3 Assoc_containers.3 Iterator_types.3'
for f in $problematic; do
@@ -321,7 +324,7 @@ a\
done
# Also, break this (generated) line up. It's ugly as sin.
-problematic=`grep -l '[^^]Definition at line' *.3`
+problematic=`grep -l '[^^]Definition at line' *.3 *.3cxx`
for f in $problematic; do
sed 's/Definition at line/\
.PP\
@@ -452,8 +455,8 @@ for f in ios streambuf istream ostream i
istringstream ostringstream stringstream filebuf ifstream \
ofstream fstream string
do
- echo ".so man3/std::basic_${f}.3" > std::${f}.3
- echo ".so man3/std::basic_${f}.3" > std::w${f}.3
+ echo ".so man3/std::basic_${f}.3cxx" > std::${f}.3cxx
+ echo ".so man3/std::basic_${f}.3cxx" > std::w${f}.3cxx
done
echo ::

View File

@@ -0,0 +1,12 @@
# DP: Don't run the libstdc++ testsuite on arm, hppa and mipsel (timeouts on the buildds)
--- a/src/libstdc++-v3/testsuite/Makefile.in
+++ b/src/libstdc++-v3/testsuite/Makefile.in
@@ -567,6 +567,7 @@
# Run the testsuite in normal mode.
check-DEJAGNU $(check_DEJAGNU_normal_targets): check-DEJAGNU%: site.exp
+ case "$(target)" in arm*|hppa*|mipsel*) exit 0;; esac; \
$(if $*,@)AR="$(AR)"; export AR; \
RANLIB="$(RANLIB)"; export RANLIB; \
if [ -z "$*" ] && [ "$(filter -j, $(MFLAGS))" = "-j" ]; then \

View File

@@ -0,0 +1,38 @@
# DP: Don't run the libstdc++-v3 testsuite in thumb mode on armel
Index: testsuite/Makefile.in
===================================================================
--- a/src/libstdc++-v3/testsuite/Makefile.in (revision 156820)
+++ b/src/libstdc++-v3/testsuite/Makefile.in (working copy)
@@ -583,6 +583,8 @@
srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
EXPECT=$(EXPECT); export EXPECT; \
runtest=$(RUNTEST); \
+ runtestflags="`echo '$(RUNTESTFLAGS)' | sed 's/,-marm/-marm/'`"; \
+ case "$$runtestflags" in *\\{\\}) runtestflags=; esac; \
if [ -z "$$runtest" ]; then runtest=runtest; fi; \
tool=libstdc++; \
dirs=; \
@@ -590,7 +592,7 @@
normal0) \
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
$$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) \
- $(RUNTESTFLAGS) abi.exp; \
+ $$runtestflags abi.exp; \
else echo "WARNING: could not find \`runtest'" 1>&2; :;\
fi; \
dirs="`cd $$srcdir; echo [013-9][0-9]_*/* [abep]*/*`";; \
@@ -605,11 +607,11 @@
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
if [ -n "$$dirs" ]; then \
$$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) \
- $(RUNTESTFLAGS) \
+ $$runtestflags \
"conformance.exp=`echo $$dirs | sed 's/ /* /g;s/$$/*/'`"; \
else \
$$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) \
- $(RUNTESTFLAGS); \
+ $$runtestflags; \
fi; \
else echo "WARNING: could not find \`runtest'" 1>&2; :;\
fi

91
debian/patches/libstdc++-pic.diff vendored Normal file
View File

@@ -0,0 +1,91 @@
# DP: Build and install libstdc++_pic.a library.
--- a/src/libstdc++-v3/src/Makefile.am
+++ b/src/libstdc++-v3/src/Makefile.am
@@ -379,10 +379,12 @@ if GLIBCXX_BUILD_DEBUG
STAMP_DEBUG = build-debug
STAMP_INSTALL_DEBUG = install-debug
CLEAN_DEBUG = debug
+STAMP_INSTALL_PIC = install-pic
else
STAMP_DEBUG =
STAMP_INSTALL_DEBUG =
CLEAN_DEBUG =
+STAMP_INSTALL_PIC =
endif
# Build a debug variant.
@@ -425,6 +427,7 @@ build-debug: stamp-debug $(debug_backtra
mv Makefile Makefile.tmp; \
sed -e 's,all-local: all-once,all-local:,' \
-e 's,install-data-local: install-data-once,install-data-local:,' \
+ -e 's,install-exec-local:.*,install-exec-local:,' \
-e '/vpath/!s,src/c,src/debug/c,' \
< Makefile.tmp > Makefile ; \
rm -f Makefile.tmp ; \
@@ -435,3 +438,8 @@ build-debug: stamp-debug $(debug_backtra
install-debug: build-debug
(cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \
toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) ;
+
+install-exec-local: $(STAMP_INSTALL_PIC)
+$(STAMP_INSTALL_PIC):
+ $(MKDIR_P) $(DESTDIR)$(toolexeclibdir)
+ $(INSTALL_DATA) .libs/libstdc++convenience.a $(DESTDIR)$(toolexeclibdir)/libstdc++_pic.a
--- a/src/libstdc++-v3/src/Makefile.in
+++ b/src/libstdc++-v3/src/Makefile.in
@@ -676,6 +676,8 @@ CXXLINK = \
@GLIBCXX_BUILD_DEBUG_TRUE@STAMP_INSTALL_DEBUG = install-debug
@GLIBCXX_BUILD_DEBUG_FALSE@CLEAN_DEBUG =
@GLIBCXX_BUILD_DEBUG_TRUE@CLEAN_DEBUG = debug
+@GLIBCXX_BUILD_DEBUG_FALSE@STAMP_INSTALL_PIC =
+@GLIBCXX_BUILD_DEBUG_TRUE@STAMP_INSTALL_PIC = install-pic
# Build a debug variant.
# Take care to fix all possibly-relative paths.
@@ -944,7 +946,7 @@ install-dvi: install-dvi-recursive
install-dvi-am:
-install-exec-am: install-toolexeclibLTLIBRARIES
+install-exec-am: install-exec-local install-toolexeclibLTLIBRARIES
install-html: install-html-recursive
@@ -994,11 +996,11 @@ uninstall-am: uninstall-toolexeclibLTLIB
distclean-libtool distclean-tags dvi dvi-am html html-am info \
info-am install install-am install-data install-data-am \
install-data-local install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip \
- install-toolexeclibLTLIBRARIES installcheck installcheck-am \
- installdirs installdirs-am maintainer-clean \
+ install-exec-am install-exec-local install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip install-toolexeclibLTLIBRARIES installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am \
@@ -1147,6 +1149,7 @@ build-debug: stamp-debug $(debug_backtra
mv Makefile Makefile.tmp; \
sed -e 's,all-local: all-once,all-local:,' \
-e 's,install-data-local: install-data-once,install-data-local:,' \
+ -e 's,install-exec-local:.*,install-exec-local:,' \
-e '/vpath/!s,src/c,src/debug/c,' \
< Makefile.tmp > Makefile ; \
rm -f Makefile.tmp ; \
@@ -1158,6 +1161,11 @@ install-debug: build-debug
(cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \
toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) ;
+install-exec-local: $(STAMP_INSTALL_PIC)
+$(STAMP_INSTALL_PIC):
+ $(MKDIR_P) $(DESTDIR)$(toolexeclibdir)
+ $(INSTALL_DATA) .libs/libstdc++convenience.a $(DESTDIR)$(toolexeclibdir)/libstdc++_pic.a
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

22
debian/patches/libstdc++-pythondir.diff vendored Normal file
View File

@@ -0,0 +1,22 @@
--- a/src/libstdc++-v3/python/Makefile.am
+++ b/src/libstdc++-v3/python/Makefile.am
@@ -26,7 +26,7 @@ include $(top_srcdir)/fragment.am
if ENABLE_PYTHONDIR
pythondir = $(prefix)/$(python_mod_dir)
else
-pythondir = $(datadir)/gcc-$(gcc_version)/python
+pythondir = $(datadir)/gcc/python
endif
if GLIBCXX_BUILD_DEBUG
--- a/src/libstdc++-v3/python/Makefile.in
+++ b/src/libstdc++-v3/python/Makefile.in
@@ -409,7 +409,7 @@ WARN_CXXFLAGS = \
# -I/-D flags to pass when compiling.
AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS)
-@ENABLE_PYTHONDIR_FALSE@pythondir = $(datadir)/gcc-$(gcc_version)/python
+@ENABLE_PYTHONDIR_FALSE@pythondir = $(datadir)/gcc/python
@ENABLE_PYTHONDIR_TRUE@pythondir = $(prefix)/$(python_mod_dir)
@GLIBCXX_BUILD_DEBUG_FALSE@debug_gdb_py =
@GLIBCXX_BUILD_DEBUG_TRUE@debug_gdb_py = YES

View File

@@ -0,0 +1,76 @@
# DP: Add support to run the libstdc++-v3 testsuite using the
# DP: installed shared libraries.
--- a/src/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/src/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -37,6 +37,12 @@
# the last thing before testing begins. This can be defined in, e.g.,
# ~/.dejagnurc or $DEJAGNU.
+set test_installed 0
+if [info exists env(TEST_INSTALLED)] {
+ verbose -log "test installed libstdc++-v3"
+ set test_installed 1
+}
+
proc load_gcc_lib { filename } {
global srcdir loaded_libs
@@ -116,6 +122,7 @@ proc libstdc++_init { testfile } {
global tool_timeout
global DEFAULT_CXXFLAGS
global STATIC_LIBCXXFLAGS
+ global test_installed
# We set LC_ALL and LANG to C so that we get the same error
# messages as expected.
@@ -135,6 +142,9 @@ proc libstdc++_init { testfile } {
set blddir [lookfor_file [get_multilibs] libstdc++-v3]
set flags_file "${blddir}/scripts/testsuite_flags"
+ if {$test_installed} {
+ set flags_file "${blddir}/scripts/testsuite_flags.installed"
+ }
set shlib_ext [get_shlib_extension]
v3track flags_file 2
@@ -167,7 +177,11 @@ proc libstdc++_init { testfile } {
# Locate libgcc.a so we don't need to account for different values of
# SHLIB_EXT on different platforms
- set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+ if {$test_installed} {
+ set gccdir ""
+ } else {
+ set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+ }
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
append ld_library_path_tmp ":${gccdir}"
@@ -187,7 +201,11 @@ proc libstdc++_init { testfile } {
# Locate libgomp. This is only required for parallel mode.
set v3-libgomp 0
- set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.$shlib_ext]
+ if {$test_installed} {
+ set libgompdir ""
+ } else {
+ set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.$shlib_ext]
+ }
if {$libgompdir != ""} {
set v3-libgomp 1
set libgompdir [file dirname $libgompdir]
@@ -209,7 +227,12 @@ proc libstdc++_init { testfile } {
# Locate libstdc++ shared library. (ie libstdc++.so.)
set v3-sharedlib 0
- set sharedlibdir [lookfor_file $blddir src/.libs/libstdc++.$shlib_ext]
+ if {$test_installed} {
+ set sharedlibdir ""
+ set v3-sharedlib 1
+ } else {
+ set sharedlibdir [lookfor_file $blddir src/.libs/libstdc++.$shlib_ext]
+ }
if {$sharedlibdir != ""} {
if { ([string match "*-*-gnu*" $target_triplet]
|| [string match "*-*-linux*" $target_triplet]

21
debian/patches/musl-ssp.diff vendored Normal file
View File

@@ -0,0 +1,21 @@
See https://git.alpinelinux.org/aports/commit/?id=d307f133de1f8a9993ab0d6fd51176b9373df4c3
and https://www.openwall.com/lists/musl/2014/11/05/3
--- a/src/gcc/gcc.cc
+++ b/src/gcc/gcc.cc
@@ -1102,8 +1102,15 @@ proper position among the other output f
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
+#if DEFAULT_LIBC == LIBC_MUSL
+/* When linking without -fstack-protector-something but including objects that
+ were built with -fstack-protector-something, calls to __stack_chk_fail_local
+ can be emitted. Thus -lssp_nonshared must be linked unconditionally. */
+#define LINK_SSP_SPEC "-lssp_nonshared"
+#else
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit:}"
+#endif
#else
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
"|fstack-protector-strong|fstack-protector-explicit" \

125
debian/patches/note-gnu-stack.diff vendored Normal file
View File

@@ -0,0 +1,125 @@
# DP: Add .note.GNU-stack sections for gcc's crt files, libffi and boehm-gc
# DP: Taken from FC.
gcc/
2004-09-20 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
on ppc64-linux.
* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
ia64-linux.
* config/ia64/crtbegin.asm: Likewise.
* config/ia64/crtend.asm: Likewise.
* config/ia64/crti.asm: Likewise.
* config/ia64/crtn.asm: Likewise.
2004-05-14 Jakub Jelinek <jakub@redhat.com>
* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
libffi/
2007-05-11 Daniel Jacobowitz <dan@debian.org>
* src/arm/sysv.S: Fix ARM comment marker.
2005-02-08 Jakub Jelinek <jakub@redhat.com>
* src/alpha/osf.S: Add .note.GNU-stack on Linux.
* src/s390/sysv.S: Likewise.
* src/powerpc/linux64.S: Likewise.
* src/powerpc/linux64_closure.S: Likewise.
* src/powerpc/ppc_closure.S: Likewise.
* src/powerpc/sysv.S: Likewise.
* src/x86/unix64.S: Likewise.
* src/x86/sysv.S: Likewise.
* src/sparc/v8.S: Likewise.
* src/sparc/v9.S: Likewise.
* src/m68k/sysv.S: Likewise.
* src/ia64/unix.S: Likewise.
* src/arm/sysv.S: Likewise.
---
gcc/config/ia64/linux.h | 3 +++
gcc/config/rs6000/ppc-asm.h | 2 +-
libgcc/config/ia64/crtbegin.S | 4 ++++
libgcc/config/ia64/crtend.S | 4 ++++
libgcc/config/ia64/crti.S | 4 ++++
libgcc/config/ia64/crtn.S | 4 ++++
libgcc/config/ia64/lib1funcs.S | 4 ++++
9 files changed, 39 insertions(+), 13 deletions(-)
--- a/src/libgcc/config/ia64/crtbegin.S
+++ b/src/libgcc/config/ia64/crtbegin.S
@@ -185,3 +185,7 @@ __do_global_dtors_aux:
.weak __cxa_finalize
#endif
.weak _Jv_RegisterClasses
+
+#ifdef __linux__
+.section .note.GNU-stack; .previous
+#endif
--- a/src/libgcc/config/ia64/crtend.S
+++ b/src/libgcc/config/ia64/crtend.S
@@ -114,3 +114,7 @@ __do_global_ctors_aux:
br.ret.sptk.many rp
.endp __do_global_ctors_aux
+
+#ifdef __linux__
+.section .note.GNU-stack; .previous
+#endif
--- a/src/libgcc/config/ia64/crti.S
+++ b/src/libgcc/config/ia64/crti.S
@@ -51,3 +51,7 @@ _fini:
.body
# end of crti.S
+
+#ifdef __linux__
+.section .note.GNU-stack; .previous
+#endif
--- a/src/libgcc/config/ia64/crtn.S
+++ b/src/libgcc/config/ia64/crtn.S
@@ -41,3 +41,7 @@
br.ret.sptk.many b0
# end of crtn.S
+
+#ifdef __linux__
+.section .note.GNU-stack; .previous
+#endif
--- a/src/libgcc/config/ia64/lib1funcs.S
+++ b/src/libgcc/config/ia64/lib1funcs.S
@@ -793,3 +793,7 @@ __floattitf:
.endp __floattitf
#endif
#endif
+
+#ifdef __linux__
+.section .note.GNU-stack; .previous
+#endif
--- a/src/gcc/config/ia64/linux.h
+++ b/src/gcc/config/ia64/linux.h
@@ -79,5 +79,8 @@ do { \
#undef TARGET_INIT_LIBFUNCS
#define TARGET_INIT_LIBFUNCS ia64_soft_fp_init_libfuncs
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
/* Define this to be nonzero if static stack checking is supported. */
#define STACK_CHECK_STATIC_BUILTIN 1
--- a/src/gcc/config/rs6000/ppc-asm.h
+++ b/src/gcc/config/rs6000/ppc-asm.h
@@ -384,7 +384,7 @@ GLUE(.L,name): \
#endif
#endif
-#if defined __linux__ && !defined __powerpc64__
+#if defined __linux__
.section .note.GNU-stack
.previous
#endif

14
debian/patches/pr104290-followup.diff vendored Normal file
View File

@@ -0,0 +1,14 @@
# DP: Follow-up patch for PR go/104290 (Hurd)
--- a/src/gcc/config/gnu.h
+++ b/src/gcc/config/gnu.h
@@ -19,6 +19,9 @@ You should have received a copy of the G
along with GCC. If not, see <http://www.gnu.org/licenses/>.
*/
+#define OPTION_GLIBC_P(opts) (DEFAULT_LIBC == LIBC_GLIBC)
+#define OPTION_GLIBC OPTION_GLIBC_P (&global_options)
+
#undef GNU_USER_TARGET_OS_CPP_BUILTINS
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
do { \

10
debian/patches/pr107475.diff vendored Normal file
View File

@@ -0,0 +1,10 @@
--- a/src/gcc/ada/Makefile.rtl
+++ b/src/gcc/ada/Makefile.rtl
@@ -2653,6 +2653,7 @@ ifeq ($(strip $(filter-out %x32 linux%,$
EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
EH_MECHANISM=-gcc
THREADSLIB=-lpthread -lrt
+ MISCLIB = -ldl
GNATLIB_SHARED=gnatlib-shared-dual
GMEM_LIB = gmemlib
LIBRARY_VERSION := $(LIB_VERSION)

66
debian/patches/pr118045.diff vendored Normal file
View File

@@ -0,0 +1,66 @@
--- a/src/libgm2/libm2iso/Makefile.am
+++ b/src/libgm2/libm2iso/Makefile.am
@@ -215,7 +215,7 @@ if ENABLE_DARWIN_AT_RPATH
libm2iso_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/
endif
-libm2iso_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2iso_la_link_flags)
+libm2iso_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2iso_la_link_flags) -lm
CLEANFILES = SYSTEM.def
BUILT_SOURCES = SYSTEM.def
--- a/src/libgm2/libm2iso/Makefile.in
+++ b/src/libgm2/libm2iso/Makefile.in
@@ -597,7 +597,7 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
@BUILD_ISOLIB_TRUE@@TARGET_DARWIN_FALSE@ $(am__append_1)
@BUILD_ISOLIB_TRUE@@TARGET_DARWIN_TRUE@libm2iso_la_link_flags = -Wl,-undefined,dynamic_lookup \
@BUILD_ISOLIB_TRUE@@TARGET_DARWIN_TRUE@ $(am__append_1)
-@BUILD_ISOLIB_TRUE@libm2iso_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2iso_la_link_flags)
+@BUILD_ISOLIB_TRUE@libm2iso_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2iso_la_link_flags) -lm
@BUILD_ISOLIB_TRUE@CLEANFILES = SYSTEM.def
@BUILD_ISOLIB_TRUE@BUILT_SOURCES = SYSTEM.def
@BUILD_ISOLIB_TRUE@M2LIBDIR = /m2/m2iso/
--- a/src/libgm2/libm2log/Makefile.am
+++ b/src/libgm2/libm2log/Makefile.am
@@ -147,7 +147,7 @@ endif
if ENABLE_DARWIN_AT_RPATH
libm2log_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/
endif
-libm2log_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2log_la_link_flags)
+libm2log_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2log_la_link_flags) -lm
BUILT_SOURCES = ../libm2pim/SYSTEM.def
M2LIBDIR = /m2/m2log/
--- a/src/libgm2/libm2log/Makefile.in
+++ b/src/libgm2/libm2log/Makefile.in
@@ -492,7 +492,7 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
@BUILD_LOGLIB_TRUE@@TARGET_DARWIN_FALSE@ $(am__append_1)
@BUILD_LOGLIB_TRUE@@TARGET_DARWIN_TRUE@libm2log_la_link_flags = -Wl,-undefined,dynamic_lookup \
@BUILD_LOGLIB_TRUE@@TARGET_DARWIN_TRUE@ $(am__append_1)
-@BUILD_LOGLIB_TRUE@libm2log_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2log_la_link_flags)
+@BUILD_LOGLIB_TRUE@libm2log_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2log_la_link_flags) -lm
@BUILD_LOGLIB_TRUE@BUILT_SOURCES = ../libm2pim/SYSTEM.def
@BUILD_LOGLIB_TRUE@M2LIBDIR = /m2/m2log/
all: $(BUILT_SOURCES)
--- a/src/libgm2/libm2pim/Makefile.am
+++ b/src/libgm2/libm2pim/Makefile.am
@@ -183,7 +183,7 @@ endif
if ENABLE_DARWIN_AT_RPATH
libm2pim_la_link_flags += -nodefaultrpaths -Wl,-rpath,@loader_path/
endif
-libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2pim_la_link_flags)
+libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2pim_la_link_flags) -lm
BUILT_SOURCES = SYSTEM.def
CLEANFILES = SYSTEM.def
--- a/src/libgm2/libm2pim/Makefile.in
+++ b/src/libgm2/libm2pim/Makefile.in
@@ -556,7 +556,7 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
@BUILD_PIMLIB_TRUE@@TARGET_DARWIN_FALSE@ $(am__append_1)
@BUILD_PIMLIB_TRUE@@TARGET_DARWIN_TRUE@libm2pim_la_link_flags = -Wl,-undefined,dynamic_lookup \
@BUILD_PIMLIB_TRUE@@TARGET_DARWIN_TRUE@ $(am__append_1)
-@BUILD_PIMLIB_TRUE@libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2pim_la_link_flags)
+@BUILD_PIMLIB_TRUE@libm2pim_la_LINK = $(LINK) -version-info $(libtool_VERSION) $(libm2pim_la_link_flags) -lm
@BUILD_PIMLIB_TRUE@BUILT_SOURCES = SYSTEM.def
@BUILD_PIMLIB_TRUE@CLEANFILES = SYSTEM.def
@BUILD_PIMLIB_TRUE@M2LIBDIR = /m2/m2pim/

Some files were not shown because too many files have changed in this diff Show More