aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-06-21 18:19:36 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-06-27 14:05:52 +0200
commit4a48a38fa99f067b8f3a3d1a5dc7a1e602db351f (patch)
tree7551c15a8a718ce752d7f53f66511c7d2a7a4ce2
parent2ed0e911e40e1182d58d19e79cfed72c04d2fd66 (diff)
downloadgcc-4a48a38fa99f067b8f3a3d1a5dc7a1e602db351f.zip
gcc-4a48a38fa99f067b8f3a3d1a5dc7a1e602db351f.tar.gz
gcc-4a48a38fa99f067b8f3a3d1a5dc7a1e602db351f.tar.bz2
ada: Fix build of GNAT tools
gcc/ada/ * gcc-interface/Makefile.in (LIBIBERTY): Fix condition. (TOOLS_LIBS): Add @LD_PICFLAG@.
-rw-r--r--gcc/ada/gcc-interface/Makefile.in9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index dc0e54f..b5243a2 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -240,10 +240,10 @@ ALL_CPPFLAGS = $(CPPFLAGS)
ALL_COMPILERFLAGS = $(ALL_CFLAGS)
# This is where we get libiberty.a from.
-ifeq ($(PICFLAG),)
-LIBIBERTY = ../../libiberty/libiberty.a
-else
+ifneq ($(findstring $(PICFLAG),-fPIC -fPIE),)
LIBIBERTY = ../../libiberty/pic/libiberty.a
+else
+LIBIBERTY = ../../libiberty/libiberty.a
endif
# We need to link against libbacktrace because diagnostic.c in
@@ -261,6 +261,9 @@ TOOLS_LIBS = ../version.o ../link.o ../targext.o ../../ggc-none.o \
$(LIBGNAT) $(LIBINTL) $(LIBICONV) ../$(LIBBACKTRACE) ../$(LIBIBERTY) \
$(SYSLIBS) $(TGT_LIB)
+# Add -no-pie to TOOLS_LIBS since some of them are compiled with -fno-PIE.
+TOOLS_LIBS += @LD_PICFLAG@
+
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
# so that tm.h and config.h will be found in the compilation