Skip to contentSkip to conversation

toolchain rework, part 1

PATCH New Gustavo Zacarias 3 participants 8 messages Dec 6, 2010 – Dec 27, 2010

lore
Share & tools
lore
#0 lore raw

cover toolchain rework, part 1

This is the first batch of patches for the internal toolchain rework.

In this first stage we convert gmp, mpfr and mpc to proper packages and hook them up for use in the current toolchain.

We also fix a small bug in the package infra with regards to versioned patches that'll be required to avoid duplication in the binutils/gcc migration.

#1 lore raw

PATCH 1/5 gmp: make it a proper package and bump to version 5.0.1

* Convert gmp to a proper autotargets package
* Bump to version 5.0.1
* Hook it up for binutils/gcc to use

---
 package/gmp/Config.in           |   12 +----
 package/gmp/gmp.mk              |  109 ++------------------------------------
 toolchain/binutils/binutils.mk  |   12 ++---
 toolchain/gcc/gcc-uclibc-4.x.mk |    6 +-
 4 files changed, 16 insertions(+), 123 deletions(-)
package/gmp/Config.in +2 -10
index 74596f8..226e088 100644
@@ -1,14 +1,6 @@
-config BR2_PACKAGE_LIBGMP
+config BR2_PACKAGE_GMP
 	bool "gmp"
 	help
 	  GNU Multiple Precision Arithmetic Library.
 
-	  http://www.swox.com/gmp/
-
-
-config BR2_PACKAGE_LIBGMP_HEADERS
-	bool "gmp headers for target"
-	depends on BR2_PACKAGE_LIBGMP
-	help
-	  Install the gmp.h for the target.
-
+	  http://gmplib.org/
package/gmp/gmp.mk +6 -103

114 lines not on this page · raw message

toolchain/binutils/binutils.mk +5 -7
index ef9f644..327a0f6 100644
@@ -16,17 +16,15 @@ endif
 BINUTILS_HOST_PREREQ:=
 BINUTILS_TARGET_PREREQ:=
 
-BINUTILS_HOST_PREREQ:=$(TOOLCHAIN_DIR)/gmp/lib/libgmp$(HOST_LIBEXT) \
-	$(TOOLCHAIN_DIR)/mpfr/lib/libmpfr$(HOST_LIBEXT)
-HOST_SOURCE += host-libgmp-source host-libmpfr-source
+BINUTILS_HOST_PREREQ:=host-gmp $(TOOLCHAIN_DIR)/mpfr/lib/libmpfr$(HOST_LIBEXT)
+HOST_SOURCE += host-gmp-source host-libmpfr-source
 
-BINUTILS_TARGET_PREREQ:=$(TARGET_DIR)/usr/lib/libgmp$(LIBTGTEXT) \
-	$(TARGET_DIR)/usr/lib/libmpfr$(LIBTGTEXT)
+BINUTILS_TARGET_PREREQ:=gmp $(TARGET_DIR)/usr/lib/libmpfr$(LIBTGTEXT)
 
-EXTRA_BINUTILS_CONFIG_OPTIONS+=--with-gmp="$(GMP_HOST_DIR)"
+EXTRA_BINUTILS_CONFIG_OPTIONS+=--with-gmp=$(HOST_DIR)/usr
 EXTRA_BINUTILS_CONFIG_OPTIONS+=--with-mpfr="$(MPFR_HOST_DIR)"
 
-BINUTILS_TARGET_CONFIG_OPTIONS=--with-gmp="$(GMP_TARGET_DIR)"
+BINUTILS_TARGET_CONFIG_OPTIONS=--with-gmp=$(STAGING_DIR)/usr
 BINUTILS_TARGET_CONFIG_OPTIONS+=--with-mpfr="$(MPFR_TARGET_DIR)"
 
 ifeq ($(BR2_PACKAGE_LIBMPC),y)
toolchain/gcc/gcc-uclibc-4.x.mk +3 -3
index af085f7..cbcaadb 100644
@@ -106,9 +106,9 @@ ifeq ($(BR2_INSTALL_OBJC),y)
 GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),objc
 endif
 
-GCC_WITH_HOST_GMP=--with-gmp=$(GMP_HOST_DIR)
+GCC_WITH_HOST_GMP = --with-gmp=$(HOST_DIR)/usr
 GCC_WITH_HOST_MPFR=--with-mpfr=$(MPFR_HOST_DIR)
-HOST_SOURCE += host-libgmp-source host-libmpfr-source
+HOST_SOURCE += host-gmp-source host-libmpfr-source
 
 ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
 GCC_WITH_HOST_MPC=--with-mpc=$(MPC_HOST_DIR)
@@ -119,7 +119,7 @@ ifeq ($(BR2_INSTALL_FORTRAN),y)
 GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),fortran
 #GCC_TARGET_PREREQ+=$(TARGET_DIR)/usr/lib/libmpfr.so $(TARGET_DIR)/usr/lib/libgmp.so
 #GCC_STAGING_PREREQ+=$(TOOLCHAIN_DIR)/mpfr/lib/libmpfr.so
-GCC_WITH_TARGET_GMP=--with-gmp="$(GMP_TARGET_DIR)"
+GCC_WITH_TARGET_GMP = --with-gmp=$(STAGING_DIR)/usr
 GCC_WITH_TARGET_MPFR=--with-mpfr="$(MPFR_TARGET_DIR)"
 ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
 GCC_WITH_TARGET_MPC=--with-mpc="$(MPC_TARGET_DIR)"
Signature · 1 line
1.7.2.2
#2 lore raw

PATCH 2/5 php: libgmp was renamed to gmp

In reply to Gustavo Zacarias
---
 package/php/Config.ext |    2 +-
 package/php/php.mk     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/php/Config.ext +1 -1
index 5c7f5ea..4f1614e 100644
@@ -77,7 +77,7 @@ comment "gettext support requires a toolchain with WCHAR support"
 
 config BR2_PACKAGE_PHP_EXT_GMP
 	bool "gmp"
-	select BR2_PACKAGE_LIBGMP
+	select BR2_PACKAGE_GMP
 	help
 	  GMP support
 
package/php/php.mk +1 -1
index af4fa29..f3ed0f1 100644
@@ -89,7 +89,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_PHP_EXT_GMP),y)
 	PHP_CONF_OPT += --with-gmp=$(STAGING_DIR)/usr
-	PHP_DEPENDENCIES += libgmp
+	PHP_DEPENDENCIES += gmp
 endif
 
 ifeq ($(BR2_PACKAGE_PHP_EXT_JSON),y)
Signature · 1 line
1.7.2.2
#3 lore raw

PATCH 3/5 mpfr: make it a proper package and bump to version 3.0.0-p8

In reply to Gustavo Zacarias

* Convert mpfr to a proper autotargets package
* Bump to version 3.0.0-p8
* Hook it up for binutils/gcc to use

---
 package/mpfr/Config.in           |   13 +-
 package/mpfr/mpfr-3.0.0-p8.patch | 1950 ++++++++++++++++++++++++++++++++++++++
 package/mpfr/mpfr.mk             |  126 +---
 toolchain/binutils/binutils.mk   |   10 +-
 toolchain/gcc/gcc-uclibc-4.x.mk  |    6 +-
 5 files changed, 1969 insertions(+), 136 deletions(-)
 create mode 100644 package/mpfr/mpfr-3.0.0-p8.patch
package/mpfr/Config.in +2 -11
index 302f79e..9acb0b4 100644
@@ -1,18 +1,9 @@
-config BR2_PACKAGE_LIBMPFR
+config BR2_PACKAGE_MPFR
 	bool "mpfr"
 	default y if BR2_INSTALL_FORTRAN
-	select BR2_PACKAGE_LIBGMP
+	select BR2_PACKAGE_GMP
 	help
 	  C library for multiple-precision floating-point computations
 	  with exact rounding.
 
 	  http://www.mpfr.org/
-
-
-config BR2_PACKAGE_LIBMPFR_HEADERS
-	bool "mpfr headers for target"
-	depends on BR2_PACKAGE_LIBMPFR
-	select BR2_PACKAGE_LIBGMP_HEADERS
-	help
-	  Install the mpfr headers for the target.
-
package/mpfr/mpfr-3.0.0-p8.patch new file +1950 -0

1,950 lines not on this page · raw message

package/mpfr/mpfr.mk +9 -117

131 lines not on this page · raw message

toolchain/binutils/binutils.mk +5 -5
index 327a0f6..c332590 100644
@@ -16,16 +16,16 @@ endif
 BINUTILS_HOST_PREREQ:=
 BINUTILS_TARGET_PREREQ:=
 
-BINUTILS_HOST_PREREQ:=host-gmp $(TOOLCHAIN_DIR)/mpfr/lib/libmpfr$(HOST_LIBEXT)
-HOST_SOURCE += host-gmp-source host-libmpfr-source
+BINUTILS_HOST_PREREQ:=host-gmp host-mpfr
+HOST_SOURCE += host-gmp-source host-mpfr-source
 
-BINUTILS_TARGET_PREREQ:=gmp $(TARGET_DIR)/usr/lib/libmpfr$(LIBTGTEXT)
+BINUTILS_TARGET_PREREQ:=gmp mpfr
 
 EXTRA_BINUTILS_CONFIG_OPTIONS+=--with-gmp=$(HOST_DIR)/usr
-EXTRA_BINUTILS_CONFIG_OPTIONS+=--with-mpfr="$(MPFR_HOST_DIR)"
+EXTRA_BINUTILS_CONFIG_OPTIONS+=--with-mpfr=$(HOST_DIR)/usr
 
 BINUTILS_TARGET_CONFIG_OPTIONS=--with-gmp=$(STAGING_DIR)/usr
-BINUTILS_TARGET_CONFIG_OPTIONS+=--with-mpfr="$(MPFR_TARGET_DIR)"
+BINUTILS_TARGET_CONFIG_OPTIONS+=--with-mpfr=$(STAGING_DIR)/usr
 
 ifeq ($(BR2_PACKAGE_LIBMPC),y)
 BINUTILS_ADD_MPC = y
toolchain/gcc/gcc-uclibc-4.x.mk +3 -3
index cbcaadb..ede5b7c 100644
@@ -107,8 +107,8 @@ GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),objc
 endif
 
 GCC_WITH_HOST_GMP = --with-gmp=$(HOST_DIR)/usr
-GCC_WITH_HOST_MPFR=--with-mpfr=$(MPFR_HOST_DIR)
-HOST_SOURCE += host-gmp-source host-libmpfr-source
+GCC_WITH_HOST_MPFR = --with-mpfr=$(HOST_DIR)/usr
+HOST_SOURCE += host-gmp-source host-mpfr-source
 
 ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
 GCC_WITH_HOST_MPC=--with-mpc=$(MPC_HOST_DIR)
@@ -120,7 +120,7 @@ GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),fortran
 #GCC_TARGET_PREREQ+=$(TARGET_DIR)/usr/lib/libmpfr.so $(TARGET_DIR)/usr/lib/libgmp.so
 #GCC_STAGING_PREREQ+=$(TOOLCHAIN_DIR)/mpfr/lib/libmpfr.so
 GCC_WITH_TARGET_GMP = --with-gmp=$(STAGING_DIR)/usr
-GCC_WITH_TARGET_MPFR=--with-mpfr="$(MPFR_TARGET_DIR)"
+GCC_WITH_TARGET_MPFR = --with-mpfr=$(STAGING_DIR)/usr
 ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
 GCC_WITH_TARGET_MPC=--with-mpc="$(MPC_TARGET_DIR)"
 endif
Signature · 1 line
1.7.2.2
#4 lore raw

PATCH 4/5 mpc: make it a proper package

In reply to Gustavo Zacarias

* Convert mpc to a proper autotargets package
* Hook it up for binutils/gcc to use

---
 package/mpc/Config.in           |   15 +----
 package/mpc/mpc.mk              |  109 +++------------------------------------
 toolchain/binutils/binutils.mk  |   10 ++--
 toolchain/gcc/gcc-uclibc-4.x.mk |    6 +-
 4 files changed, 18 insertions(+), 122 deletions(-)
package/mpc/Config.in +3 -12
index 61c9638..8377013 100644
@@ -1,19 +1,10 @@
-config BR2_PACKAGE_LIBMPC
+config BR2_PACKAGE_MPC
 	bool "mpc"
-	select BR2_PACKAGE_LIBMPFR
-	select BR2_PACKAGE_LIBGMP
+	select BR2_PACKAGE_MPFR
+	select BR2_PACKAGE_GMP
 	help
 	  Mpc is a C library for the arithmetic of complex numbers with
 	  arbitrarily high precision and correct rounding of the result.
 	  It is built upon and follows the same principles as Mpfr.
 
 	  http://www.multiprecision.org/
-
-
-config BR2_PACKAGE_LIBMPC_HEADERS
-	bool "mpc headers for target"
-	depends on BR2_PACKAGE_LIBMPC
-	select BR2_PACKAGE_LIBMPFR_HEADERS
-	select BR2_PACKAGE_LIBGMP_HEADERS
-	help
-	  Install the mpc headers for the target.
package/mpc/mpc.mk +7 -102

114 lines not on this page · raw message

toolchain/binutils/binutils.mk +5 -5
index c332590..8ab383b 100644
@@ -36,11 +36,11 @@ BINUTILS_ADD_MPC = y
 endif
 
 ifeq ($(BINUTILS_ADD_MPC),y)
-BINUTILS_HOST_PREREQ += $(TOOLCHAIN_DIR)/mpc/lib/libmpc$(HOST_LIBEXT)
-HOST_SOURCE += host-libmpc-source
-BINUTILS_TARGET_PREREQ += $(TARGET_DIR)/usr/lib/libmpc$(LIBTGTEXT)
-EXTRA_BINUTILS_CONFIG_OPTIONS += --with-mpc="$(MPC_HOST_DIR)"
-BINUTILS_TARGET_CONFIG_OPTIONS += --with-mpc="$(MPC_TARGET_DIR)"
+BINUTILS_HOST_PREREQ += host-mpc
+HOST_SOURCE += host-mpc-source
+BINUTILS_TARGET_PREREQ += mpc
+EXTRA_BINUTILS_CONFIG_OPTIONS += --with-mpc=$(HOST_DIR)/usr
+BINUTILS_TARGET_CONFIG_OPTIONS += --with-mpc=$(STAGING_DIR)/usr
 endif
 
 BINUTILS_PATCH_DIR:=toolchain/binutils/$(BINUTILS_VERSION)
toolchain/gcc/gcc-uclibc-4.x.mk +3 -3
index ede5b7c..6add764 100644
@@ -111,8 +111,8 @@ GCC_WITH_HOST_MPFR = --with-mpfr=$(HOST_DIR)/usr
 HOST_SOURCE += host-gmp-source host-mpfr-source
 
 ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
-GCC_WITH_HOST_MPC=--with-mpc=$(MPC_HOST_DIR)
-HOST_SOURCE += host-libmpc-source
+GCC_WITH_HOST_MPC = --with-mpc=$(HOST_DIR)/usr
+HOST_SOURCE += host-mpc-source
 endif
 
 ifeq ($(BR2_INSTALL_FORTRAN),y)
@@ -122,7 +122,7 @@ GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),fortran
 GCC_WITH_TARGET_GMP = --with-gmp=$(STAGING_DIR)/usr
 GCC_WITH_TARGET_MPFR = --with-mpfr=$(STAGING_DIR)/usr
 ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
-GCC_WITH_TARGET_MPC=--with-mpc="$(MPC_TARGET_DIR)"
+GCC_WITH_TARGET_MPC = --with-mpc=$(STAGING_DIR)/usr
 endif
 endif
 
Signature · 1 line
1.7.2.2
#5 lore raw

PATCH 5/5 package infra: fix versioned patches for host packages

In reply to Gustavo Zacarias

Without this patch we'd need separate versioned patch directories for target and host packages, thus having unwanted duplication.

---
 package/Makefile.package.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
package/Makefile.package.in +1 -1
index 816a013..4cb0334 100644
@@ -250,7 +250,7 @@ $(BUILD_DIR)/%/.stamp_patched:
 	    toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME) $(NAMEVER)\*.patch $(NAMEVER)\*.patch.$(ARCH) || exit 1; \
 	  else \
 	    toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME) $($(NOHOSTPKG)_NAME)\*.patch $($(NOHOSTPKG)_NAME)\*.patch.$(ARCH) || exit 1; \
-	    if test -d $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)/$(NAMEVER); then \
+	    if test -d $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME)/$(NAMEVER); then \
 	      toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME)/$(NAMEVER) \*.patch \*.patch.$(ARCH) || exit 1; \
 	    fi; \
 	  fi; \
Signature · 1 line
1.7.2.2
#6 lore raw

cover toolchain rework, part 1

In reply to Gustavo Zacarias

Hello,

Quoted 7 lines · On Mon, 6 Dec 2010 16:40:06 -0300 Gustavo Zacarias <[email protected]>…

This is the first batch of patches for the internal toolchain rework.

In this first stage we convert gmp, mpfr and mpc to proper packages and hook them up for use in the current toolchain.

We also fix a small bug in the package infra with regards to versioned patches that'll be required to avoid duplication in the binutils/gcc migration.

I have reviewed these patches, and tested that I could build successfully an ARM toolchain, and a native ARM toolchain for the target. The ARM cross-compiling toolchain was used to compile a complete DirectFB+Gtk stack. The native toolchain on the target was used to compile a simple hello world program, that I could execute.

Therefore, since I have also reviewed those changes, they all get my:

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#7 lore raw

cover toolchain rework, part 1

In reply to Gustavo Zacarias
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gustavo" == Gustavo Zacarias <[email protected]> writes:

Gustavo> This is the first batch of patches for the internal toolchain Gustavo> rework. In this first stage we convert gmp, mpfr and mpc to Gustavo> proper packages and hook them up for use in the current Gustavo> toolchain.

Gustavo> We also fix a small bug in the package infra with regards to Gustavo> versioned patches that'll be required to avoid duplication in Gustavo> the binutils/gcc migration.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard