delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/03/27/10:08:53

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <47EB8026.7070506@gnu.org>
Date: Thu, 27 Mar 2008 12:08:22 +0100
From: Paolo Bonzini <bonzini AT gnu DOT org>
User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213)
MIME-Version: 1.0
To: Andreas Schwab <schwab AT suse DOT de>
CC: GCC Patches <gcc-patches AT gcc DOT gnu DOT org>, cygwin AT cygwin DOT com
Subject: Re: [PATCH] Build system cleanups 1/4
References: <47EB7269 DOT 3090309 AT gnu DOT org> <jeej9wihzp DOT fsf AT sykes DOT suse DOT de> <47EB7928 DOT 5050407 AT gnu DOT org> <je1w5wigpv DOT fsf AT sykes DOT suse DOT de>
In-Reply-To: <je1w5wigpv.fsf@sykes.suse.de>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------010803020002070207000509
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Andreas Schwab wrote:
> Paolo Bonzini <bonzini AT gnu DOT org> writes:
> 
>> If so, were you aware that the target libiberty is not compiled as
>> PIC?
> 
> This is not true.

Here is the patch I'll test.  I'll commit this as build system 
maintainer; of course any other patch to convert libiberty to libtool 
will have to be approved by the libiberty maintainers.

Paolo

--------------010803020002070207000509
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
 name="libiberty-pic.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="libiberty-pic.patch"

2008-03-27  Paolo Bonzini  <bonzini AT gnu DOT org>

	* configure.ac (frags): Don't set, use frag instead.
	(PICFLAG): Set here and substitute.
	* Makefile.in: Substitute from autoconf.
	* configure: Regenerate.

Index: configure.ac
===================================================================
--- configure.ac	(revision 132479)
+++ configure.ac	(working copy)
@@ -187,9 +187,7 @@ case "${host}" in
 esac
 
 if [[ -n "${frag}" ]]; then
-  frags=${libiberty_topdir}/libiberty/config/$frag
-else
-  frags=
+  frag=${libiberty_topdir}/libiberty/config/$frag
 fi
 
 # If they didn't specify --enable-shared, don't generate shared libs.
@@ -200,34 +198,34 @@ case "${enable_shared}" in
   *) shared=yes ;;
 esac
 if [[ "${shared}" = "yes" ]]; then
-  frag=
   case "${host}" in
     *-*-cygwin*)	;;
-    alpha*-*-linux*)	frag=mh-elfalphapic ;;
-    arm*-*-*)		frag=mh-armpic ;;
-    hppa*-*-*)		frag=mh-papic ;;
+    alpha*-*-linux*)	PICFLAG=-fPIC ;;
+    arm*-*-*)		PICFLAG=-fPIC ;;
+    hppa*-*-*)		PICFLAG=-fPIC ;;
+    i370-*-*)		PICFLAG=-fPIC ;;
+    ia64-*-*)		PICFLAG=-fpic ;;
     i[[34567]]86-*-* | x86_64-*-*)
-			frag=mh-x86pic ;;
+			PICFLAG=-fpic ;;
+    m68k-*-*)		PICFLAG=-fpic ;;
     powerpc*-*-aix*)	;;
-    powerpc*-*-*)	frag=mh-ppcpic ;;
-    sparc*-*-*)		frag=mh-sparcpic ;;
-    s390*-*-*)		frag=mh-s390pic ;;
-    *)			frag=mh-${host_cpu}pic ;;
+    powerpc*-*-*)	PICFLAG=-fPIC ;;
+    sparc*-*-*)		case "${CFLAGS}" in
+			  *-fpic* ) PICFLAG=-fpic ;;
+			  * ) PICFLAG=-fPIC ;;
+			esac ;;
+    s390*-*-*)		PICFLAG=-fpic ;;
   esac
-  if [[ -n "${frag}" ]]; then
-    frags="${frags} ${libiberty_topdir}/config/${frag}"
-  fi
 fi
+AC_SUBST(PICFLAG)
 
 echo "# Warning: this fragment is automatically generated" > temp-frag
 
-for frag in ${frags}; do
-  if [[ -f ${frag} ]]; then
-    echo "Appending ${frag} to xhost-mkfrag"
-    echo "# Following fragment copied from ${frag}" >> temp-frag
-    cat ${frag} >> temp-frag
-  fi
-done
+if [[ -n "${frag}" ]] && [[ -f "${frag}" ]]; then
+  echo "Appending ${frag} to xhost-mkfrag"
+  echo "# Following fragment copied from ${frag}" >> temp-frag
+  cat ${frag} >> temp-frag
+fi
 
 # record if we want to build shared libs.
 if [[ "${shared}" = "yes" ]]; then
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 132479)
+++ Makefile.in	(working copy)
@@ -60,7 +60,7 @@ RANLIB = @RANLIB@
 MAKEINFO = @MAKEINFO@
 PERL = @PERL@
 
-PICFLAG =
+PICFLAG = @PICFLAG@
 
 MAKEOVERRIDES =
 


--------------010803020002070207000509
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
--------------010803020002070207000509--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019