/usr/src/gcc-8/debian/patches/ada-link-lib.diff is in gcc-8-source 8-20180414-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | 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, link with --as-needed -z defs.
.
Please read ada-changes-in-autogen-output.diff about src/Makefile.def.
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>
Index: b/src/gcc/ada/gcc-interface/config-lang.in
===================================================================
--- a/src/gcc/ada/gcc-interface/config-lang.in
+++ b/src/gcc/ada/gcc-interface/config-lang.in
@@ -35,7 +35,7 @@ gtfiles="\$(srcdir)/ada/gcc-interface/ad
outputs="ada/gcc-interface/Makefile ada/Makefile"
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
Index: b/src/gcc/ada/link.c
===================================================================
--- 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";
Index: b/src/libada/Makefile.in
===================================================================
--- a/src/libada/Makefile.in
+++ b/src/libada/Makefile.in
@@ -78,10 +78,10 @@ ADA_RTS_SUBDIR=./rts$(subst /,_,$(MULTIS
# by recursive make invocations in gcc/ada/Makefile.in
LIBADA_FLAGS_TO_PASS = \
"MAKEOVERRIDES=" \
- "LDFLAGS=$(LDFLAGS)" \
+ "LDFLAGS=$(LDFLAGS) -Wl,--as-needed -Wl,-z,defs" \
"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)" \
Index: b/src/Makefile.def
===================================================================
--- a/src/Makefile.def
+++ b/src/Makefile.def
@@ -122,7 +122,16 @@ host_modules= { module= libtermcap; no_c
missing=distclean;
missing=maintainer-clean; };
host_modules= { module= utils; no_check=true; };
-host_modules= { module= gnattools; };
+host_modules= { module= gnattools; no_check=true;
+ missing= info;
+ missing= dvi;
+ missing= html;
+ missing= pdf;
+ missing= install-pdf;
+ missing= install-html;
+ missing= TAGS;
+ missing= install-info;
+ missing= installcheck; };
host_modules= { module= lto-plugin; bootstrap=true;
extra_configure_flags='--enable-shared @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@';
extra_make_flags='@extra_linker_plugin_flags@'; };
@@ -166,7 +175,16 @@ target_modules = { module= libgloss; no_
target_modules = { module= libffi; no_install=true; };
target_modules = { module= zlib; };
target_modules = { module= rda; };
-target_modules = { module= libada; };
+target_modules = { module= libada; no_install=true; no_check=true;
+ missing= info;
+ missing= dvi;
+ missing= html;
+ missing= pdf;
+ missing= install-html;
+ missing= install-pdf;
+ missing= TAGS;
+ missing= install-info;
+ missing= installcheck; };
target_modules = { module= libgomp; bootstrap= true; lib_path=.libs; };
target_modules = { module= libitm; lib_path=.libs; };
target_modules = { module= libatomic; lib_path=.libs; };
@@ -362,6 +380,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; };
Index: b/src/configure.ac
===================================================================
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -142,6 +142,11 @@ host_libs="intl libiberty opcodes bfd re
# If --enable-gold is used, "gold" may replace "ld".
host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
+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.
@@ -164,6 +169,7 @@ target_libraries="target-libgcc \
target-libffi \
target-libobjc \
target-libada \
+ ${target_libiberty} \
target-libgo"
# these tools are built using the target libraries, and are intended to
Index: b/src/gcc/ada/gcc-interface/Make-lang.in
===================================================================
--- a/src/gcc/ada/gcc-interface/Make-lang.in
+++ b/src/gcc/ada/gcc-interface/Make-lang.in
@@ -45,7 +45,7 @@ RMDIR = rm -rf
# Extra flags to pass to recursive makes.
-COMMON_ADAFLAGS= -gnatpg
+COMMON_ADAFLAGS= -gnatpgn
ifeq ($(TREECHECKING),)
CHECKING_ADAFLAGS=
else
@@ -233,7 +233,7 @@ else
endif
# Strip -Werror during linking for the LTO bootstrap
-GCC_LINKERFLAGS = $(filter-out -Werror, $(ALL_LINKERFLAGS))
+GCC_LINKERFLAGS = $(filter-out -Werror, $(ALL_LINKERFLAGS)) -Wl,--as-needed -Wl,-z,defs
GCC_LINK=$(LINKER) $(GCC_LINKERFLAGS) $(LDFLAGS)
GCC_LLINK=$(LLINKER) $(GCC_LINKERFLAGS) $(LDFLAGS)
|