public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Build system cleanups 1/4
@ 2008-03-27 10:31 Paolo Bonzini
  2008-03-27 10:48 ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2008-03-27 10:31 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 204 bytes --]

This one removes the PICFLAG variables, which are never set, as well as 
the makefile fragments that used to set PICFLAG *at the time of Cygnus 
configure*.

Committed to gcc and (shortly) to src.

Paolo

[-- Attachment #2: build-cleanup-1.patch --]
[-- Type: text/plain, Size: 4285 bytes --]

2008-03-27  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.tpl (PICFLAG, PICFLAG_FOR_TARGET): Remove.
	* Makefile.in: Regenerate.

config:
2008-03-27  Paolo Bonzini  <bonzini@gnu.org>

	* mh-armpic: Remove.
	* mh-i370pic: Remove.
	* mh-m68kpic: Remove.
	* mh-ppcpic: Remove.
	* mh-sparcpic: Remove.
	* mh-ia64pic: Remove.
	* mh-papic: Remove.
	* mh-s390pic: Remove.
	* mh-x86pic: Remove.

Index: Makefile.in
===================================================================
--- Makefile.in	(revision 133115)
+++ Makefile.in	(working copy)
@@ -319,7 +319,6 @@ LDFLAGS = @LDFLAGS@
 LIBCFLAGS = $(CFLAGS)
 CXXFLAGS = @CXXFLAGS@
 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
-PICFLAG = 
 
 # Only build the C compiler for stage1, because that is the only one that
 # we can guarantee will build with the native compiler, and also it is the
@@ -335,7 +334,7 @@ STAGE2_CFLAGS=$(BOOT_CFLAGS)
 STAGE3_CFLAGS=$(BOOT_CFLAGS)
 STAGE4_CFLAGS=$(BOOT_CFLAGS)
 
-STAGE1_LIBCFLAGS=@stage1_cflags@
+STAGE1_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
 STAGE2_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
 STAGE3_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
 STAGE4_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
@@ -386,7 +385,6 @@ DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_
 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
 LDFLAGS_FOR_TARGET = 
-PICFLAG_FOR_TARGET = 
 
 # ------------------------------------
 # Miscellaneous targets and flag lists
Index: Makefile.tpl
===================================================================
--- Makefile.tpl	(revision 133115)
+++ Makefile.tpl	(working copy)
@@ -322,7 +322,6 @@ LDFLAGS = @LDFLAGS@
 LIBCFLAGS = $(CFLAGS)
 CXXFLAGS = @CXXFLAGS@
 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
-PICFLAG = 
 
 # Only build the C compiler for stage1, because that is the only one that
 # we can guarantee will build with the native compiler, and also it is the
@@ -389,7 +388,6 @@ DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_
 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
 LDFLAGS_FOR_TARGET = 
-PICFLAG_FOR_TARGET = 
 
 # ------------------------------------
 # Miscellaneous targets and flag lists
Index: config/mh-ppcpic
===================================================================
--- config/mh-ppcpic	(revision 133115)
+++ config/mh-ppcpic	(working copy)
@@ -1 +0,0 @@
-PICFLAG=-fPIC
Index: config/mh-i370pic
===================================================================
--- config/mh-i370pic	(revision 133115)
+++ config/mh-i370pic	(working copy)
@@ -1 +0,0 @@
-PICFLAG=-fPIC
Index: config/mh-s390pic
===================================================================
--- config/mh-s390pic	(revision 133115)
+++ config/mh-s390pic	(working copy)
@@ -1 +0,0 @@
-PICFLAG=-fpic
Index: config/mh-papic
===================================================================
--- config/mh-papic	(revision 133115)
+++ config/mh-papic	(working copy)
@@ -1 +0,0 @@
-PICFLAG=-fPIC
Index: config/mh-sparcpic
===================================================================
--- config/mh-sparcpic	(revision 133115)
+++ config/mh-sparcpic	(working copy)
@@ -1 +0,0 @@
-PICFLAG=`case '${LIBCFLAGS} ${LIBCXXFLAGS}' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac`
Index: config/mh-elfalphapic
===================================================================
--- config/mh-elfalphapic	(revision 133115)
+++ config/mh-elfalphapic	(working copy)
@@ -1 +0,0 @@
-PICFLAG=-fPIC
Index: config/mh-x86pic
===================================================================
--- config/mh-x86pic	(revision 133115)
+++ config/mh-x86pic	(working copy)
@@ -1 +0,0 @@
-PICFLAG=-fpic
Index: config/mh-m68kpic
===================================================================
--- config/mh-m68kpic	(revision 133115)
+++ config/mh-m68kpic	(working copy)
@@ -1 +0,0 @@
-PICFLAG=-fpic
Index: config/mh-armpic
===================================================================
--- config/mh-armpic	(revision 133115)
+++ config/mh-armpic	(working copy)
@@ -1 +0,0 @@
-PICFLAG=-fPIC
Index: config/mh-ia64pic
===================================================================
--- config/mh-ia64pic	(revision 133115)
+++ config/mh-ia64pic	(working copy)
@@ -1 +0,0 @@
-PICFLAG=-fpic

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Build system cleanups 1/4
  2008-03-27 10:31 [PATCH] Build system cleanups 1/4 Paolo Bonzini
@ 2008-03-27 10:48 ` Andreas Schwab
  2008-03-27 10:55   ` Paolo Bonzini
  2008-03-27 10:56   ` Paolo Bonzini
  0 siblings, 2 replies; 10+ messages in thread
From: Andreas Schwab @ 2008-03-27 10:48 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: GCC Patches

Paolo Bonzini <bonzini@gnu.org> writes:

> This one removes the PICFLAG variables, which are never set, as well as
> the makefile fragments that used to set PICFLAG *at the time of Cygnus
> configure*.
>
> Committed to gcc and (shortly) to src.

AFAICS this is used by libiberty when --enable-shared.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Build system cleanups 1/4
  2008-03-27 10:48 ` Andreas Schwab
@ 2008-03-27 10:55   ` Paolo Bonzini
  2008-03-27 11:09     ` Andreas Schwab
  2008-03-27 10:56   ` Paolo Bonzini
  1 sibling, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2008-03-27 10:55 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: GCC Patches

Andreas Schwab wrote:
> Paolo Bonzini <bonzini@gnu.org> writes:
> 
>> This one removes the PICFLAG variables, which are never set, as well as
>> the makefile fragments that used to set PICFLAG *at the time of Cygnus
>> configure*.
>>
>> Committed to gcc and (shortly) to src.
> 
> AFAICS this is used by libiberty when --enable-shared.

Uhm, you're right.  But then it's been dead code for a while.  The 
toplevel hasn't set PICFLAG since the Autoconfiscation, and hasn't 
passed PICFLAG to the subdirectories except between this patch:

2004-12-08  David Edelsohn  <edelsohn@gnu.org>

         * Makefile.def (flags_to_pass): Add PICFLAG_FOR_TARGET.
         * Makefile.tpl (EXTRA_HOST_FLAGS): Add PICFLAG.
         (EXTRA_TARGET_FLAGS): Add PICFLAG.
         * Makefile.in: Regenerate.

and this patch:

2004-12-25  David Edelsohn  <edelsohn@gnu.org>

         Revert 2004-12-08 Makefile changes.

Paolo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Build system cleanups 1/4
  2008-03-27 10:48 ` Andreas Schwab
  2008-03-27 10:55   ` Paolo Bonzini
@ 2008-03-27 10:56   ` Paolo Bonzini
  2008-03-27 11:21     ` Andreas Schwab
  1 sibling, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2008-03-27 10:56 UTC (permalink / raw)
  To: Andreas Schwab, GCC Patches, cygwin

Andreas Schwab wrote:
> Paolo Bonzini <bonzini@gnu.org> writes:
> 
>> This one removes the PICFLAG variables, which are never set, as well as
>> the makefile fragments that used to set PICFLAG *at the time of Cygnus
>> configure*.
>>
>> Committed to gcc and (shortly) to src.
> 
> AFAICS this is used by libiberty when --enable-shared.

Also, considering that libstdc++ compiles its own cp-demangle.c, and has 
always done so since it started using the libiberty demangler (r78553):

cp-demangle.c:
         rm -f $@
         $(LN_S) $(toplevel_srcdir)/libiberty/cp-demangle.c $@
cp-demangle.lo: cp-demangle.c
         $(LTCOMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
cp-demangle.o: cp-demangle.c
         $(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<

I wonder why we still compile libiberty for the target at all.  Neither 
it nor libobjc needs it, which would leave only all-target-fastjar 
(which is a bogus target anyway) and all-target-winsup.

Cygwin people, does winsup actually need a target libiberty?  If so, 
were you aware that the target libiberty is not compiled as PIC?

Paolo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Build system cleanups 1/4
  2008-03-27 10:55   ` Paolo Bonzini
@ 2008-03-27 11:09     ` Andreas Schwab
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Schwab @ 2008-03-27 11:09 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: GCC Patches

Paolo Bonzini <bonzini@gnu.org> writes:

> Andreas Schwab wrote:
>> Paolo Bonzini <bonzini@gnu.org> writes:
>>
>>> This one removes the PICFLAG variables, which are never set, as well as
>>> the makefile fragments that used to set PICFLAG *at the time of Cygnus
>>> configure*.
>>>
>>> Committed to gcc and (shortly) to src.
>>
>> AFAICS this is used by libiberty when --enable-shared.
>
> Uhm, you're right.  But then it's been dead code for a while.

But the frags _are_ used.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Build system cleanups 1/4
  2008-03-27 10:56   ` Paolo Bonzini
@ 2008-03-27 11:21     ` Andreas Schwab
  2008-03-27 13:45       ` Paolo Bonzini
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2008-03-27 11:21 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: GCC Patches, cygwin

Paolo Bonzini <bonzini@gnu.org> writes:

> If so, were you aware that the target libiberty is not compiled as
> PIC?

This is not true.  The libiberty configure script handles that just
fine.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Build system cleanups 1/4
  2008-03-27 11:21     ` Andreas Schwab
@ 2008-03-27 13:45       ` Paolo Bonzini
  2008-03-27 15:46         ` Christopher Faylor
  0 siblings, 1 reply; 10+ messages in thread
From: Paolo Bonzini @ 2008-03-27 13:45 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: GCC Patches, cygwin

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

Andreas Schwab wrote:
> Paolo Bonzini <bonzini@gnu.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

[-- Attachment #2: libiberty-pic.patch --]
[-- Type: text/plain, Size: 2506 bytes --]

2008-03-27  Paolo Bonzini  <bonzini@gnu.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 =
 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Build system cleanups 1/4
  2008-03-27 13:45       ` Paolo Bonzini
@ 2008-03-27 15:46         ` Christopher Faylor
  2008-03-27 15:49           ` Christopher Faylor
  0 siblings, 1 reply; 10+ messages in thread
From: Christopher Faylor @ 2008-03-27 15:46 UTC (permalink / raw)
  To: cygwin, GCC Patches, Andreas Schwab

On Thu, Mar 27, 2008 at 12:08:22PM +0100, Paolo Bonzini wrote:
> Andreas Schwab wrote:
>> Paolo Bonzini <bonzini@gnu.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

>2008-03-27  Paolo Bonzini  <bonzini@gnu.org>
>
>	* configure.ac (frags): Don't set, use frag instead.
>	(PICFLAG): Set here and substitute.
>	* Makefile.in: Substitute from autoconf.
>	* configure: Regenerate.

FWIW, Cygwin's reliance on libiberty, so:

2008-03-27  Christopher Faylor  <me+cygwin@cgf.cx>

	* Makefile.in (all-target-winsup): Remove libiberty dependency.


Index: Makefile.in
===================================================================
RCS file: /cvs/uberbaum/Makefile.in,v
retrieving revision 1.279
diff -d -u -r1.279 Makefile.in
--- Makefile.in 27 Mar 2008 14:16:53 -0000      1.279
+++ Makefile.in 27 Mar 2008 15:16:59 -0000
@@ -53474,7 +53474,6 @@
 all-target-libstdc++-v3: maybe-all-target-libiberty
 configure-target-libstdc++-v3: maybe-configure-target-libgomp
 all-target-libgloss: maybe-all-target-newlib
-all-target-winsup: maybe-all-target-libiberty
 all-target-winsup: maybe-all-target-libtermcap

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Build system cleanups 1/4
  2008-03-27 15:46         ` Christopher Faylor
@ 2008-03-27 15:49           ` Christopher Faylor
  2008-03-27 19:27             ` Paolo Bonzini
  0 siblings, 1 reply; 10+ messages in thread
From: Christopher Faylor @ 2008-03-27 15:49 UTC (permalink / raw)
  To: cygwin, GCC Patches, Andreas Schwab

On Thu, Mar 27, 2008 at 11:18:32AM -0400, Christopher Faylor wrote:
>On Thu, Mar 27, 2008 at 12:08:22PM +0100, Paolo Bonzini wrote:
>> Andreas Schwab wrote:
>>> Paolo Bonzini <bonzini@gnu.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
>
>>2008-03-27  Paolo Bonzini  <bonzini@gnu.org>
>>
>>	* configure.ac (frags): Don't set, use frag instead.
>>	(PICFLAG): Set here and substitute.
>>	* Makefile.in: Substitute from autoconf.
>>	* configure: Regenerate.
>
>FWIW, Cygwin's reliance on libiberty, so:

Duh.  Try again.

Cygwin no longer relies on libiberty, so...

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Build system cleanups 1/4
  2008-03-27 15:49           ` Christopher Faylor
@ 2008-03-27 19:27             ` Paolo Bonzini
  0 siblings, 0 replies; 10+ messages in thread
From: Paolo Bonzini @ 2008-03-27 19:27 UTC (permalink / raw)
  To: cygwin, GCC Patches, Andreas Schwab


>> FWIW, Cygwin's reliance on libiberty, so:
> 
> Duh.  Try again.
> 
> Cygwin no longer relies on libiberty, so...

You should have disabled it in Makefile.def, but no big deal -- I'll 
take care of it when I'll post a patch to remove target libiberty.

Paolo

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-03-27 18:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-27 10:31 [PATCH] Build system cleanups 1/4 Paolo Bonzini
2008-03-27 10:48 ` Andreas Schwab
2008-03-27 10:55   ` Paolo Bonzini
2008-03-27 11:09     ` Andreas Schwab
2008-03-27 10:56   ` Paolo Bonzini
2008-03-27 11:21     ` Andreas Schwab
2008-03-27 13:45       ` Paolo Bonzini
2008-03-27 15:46         ` Christopher Faylor
2008-03-27 15:49           ` Christopher Faylor
2008-03-27 19:27             ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).