Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 0/4] package/guile: New package
@ 2014-11-03  0:34 Pedro Aguilar
  2014-11-03  0:34 ` [Buildroot] [PATCH v2 1/4] libatomic_ops: Add host-autotools-package Pedro Aguilar
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Pedro Aguilar @ 2014-11-03  0:34 UTC (permalink / raw)
  To: buildroot

This patch should fix all the suggestions made by Yann Morin.
It adds the following:
- libatomic_ops: Add host-autotools-package
- libunistring: Add host-autotools-package
- bdwgc: A garbage collector library for C/C++
- Guile: A progamming language similar to Lisp.

Thanks!

Pedro Aguilar (4):
  libatomic_ops: Add host-autotools-package
  bdwgc: new package
  libunistring: Add host-autotools-package
  guile: new package

 package/Config.in                                  |  2 ++
 package/bdwgc/Config.in                            | 11 ++++++++
 package/bdwgc/bdwgc.mk                             | 19 +++++++++++++
 package/guile/Config.in                            | 17 ++++++++++++
 package/guile/guile-01-fix_arm_endianness.patch    | 19 +++++++++++++
 .../guile/guile-02-calculate-csqrt_manually.patch  | 17 ++++++++++++
 .../guile-03-undef_use_gnu_local_locale_api.patch  | 16 +++++++++++
 package/guile/guile.mk                             | 32 ++++++++++++++++++++++
 package/libatomic_ops/libatomic_ops.mk             |  1 +
 package/libunistring/libunistring.mk               |  1 +
 10 files changed, 135 insertions(+)
 create mode 100644 package/bdwgc/Config.in
 create mode 100644 package/bdwgc/bdwgc.mk
 create mode 100644 package/guile/Config.in
 create mode 100644 package/guile/guile-01-fix_arm_endianness.patch
 create mode 100644 package/guile/guile-02-calculate-csqrt_manually.patch
 create mode 100644 package/guile/guile-03-undef_use_gnu_local_locale_api.patch
 create mode 100644 package/guile/guile.mk

-- 
1.9.1

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

* [Buildroot] [PATCH v2 1/4] libatomic_ops: Add host-autotools-package
  2014-11-03  0:34 [Buildroot] [PATCH v2 0/4] package/guile: New package Pedro Aguilar
@ 2014-11-03  0:34 ` Pedro Aguilar
  2014-11-03  0:34 ` [Buildroot] [PATCH v2 2/4] bdwgc: new package Pedro Aguilar
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Pedro Aguilar @ 2014-11-03  0:34 UTC (permalink / raw)
  To: buildroot

The host-libatomic_ops is needed by host-bdwgc that is needed
in turn by guile.

bdwgc bundles its own version of libatomic_ops, but it's prefered
to use the external one that is the default.

Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>

---
Changes v1 -> v2:
- Add host-libatomic_ops (suggested by Yann Morin)

Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
---
 package/libatomic_ops/libatomic_ops.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/libatomic_ops/libatomic_ops.mk b/package/libatomic_ops/libatomic_ops.mk
index d473901..6a26775 100644
--- a/package/libatomic_ops/libatomic_ops.mk
+++ b/package/libatomic_ops/libatomic_ops.mk
@@ -20,3 +20,4 @@ LIBATOMIC_OPS_LICENSE_FILES = doc/LICENSING.txt COPYING
 LIBATOMIC_OPS_INSTALL_STAGING = YES
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
-- 
1.9.1

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

* [Buildroot] [PATCH v2 2/4] bdwgc: new package
  2014-11-03  0:34 [Buildroot] [PATCH v2 0/4] package/guile: New package Pedro Aguilar
  2014-11-03  0:34 ` [Buildroot] [PATCH v2 1/4] libatomic_ops: Add host-autotools-package Pedro Aguilar
@ 2014-11-03  0:34 ` Pedro Aguilar
  2014-11-03 21:24   ` Arnout Vandecappelle
  2014-11-03  0:34 ` [Buildroot] [PATCH v2 3/4] libunistring: Add host-autotools-package Pedro Aguilar
  2014-11-03  0:34 ` [Buildroot] [PATCH v2 4/4] guile: new package Pedro Aguilar
  3 siblings, 1 reply; 9+ messages in thread
From: Pedro Aguilar @ 2014-11-03  0:34 UTC (permalink / raw)
  To: buildroot

bdwgc is a garbage collector for C and C++. The Boehm-Demers-Weiser
conservative garbage collector can be used as a garbage collecting
replacement for C 'malloc' or C++ 'new'.

Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>

---
Changes v1 -> v2
- Add external default dependency on libatomic_ops
- Fix several formatting issues
(All changes suggested by Yann Morin)

Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
---
 package/Config.in       |  1 +
 package/bdwgc/Config.in | 11 +++++++++++
 package/bdwgc/bdwgc.mk  | 19 +++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 100644 package/bdwgc/Config.in
 create mode 100644 package/bdwgc/bdwgc.mk

diff --git a/package/Config.in b/package/Config.in
index 3b3c372..bb158b4 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -942,6 +942,7 @@ endmenu
 menu "Miscellaneous"
 	source "package/aespipe/Config.in"
 	source "package/bc/Config.in"
+	source "package/bdwgc/Config.in"
 	source "package/clamav/Config.in"
 	source "package/collectd/Config.in"
 	source "package/empty/Config.in"
diff --git a/package/bdwgc/Config.in b/package/bdwgc/Config.in
new file mode 100644
index 0000000..6f3878e
--- /dev/null
+++ b/package/bdwgc/Config.in
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_BDWGC
+	bool "bdwgc"
+	depends on BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS
+	select BR2_PACKAGE_LIBATOMIC_OPS
+	help
+	  The Boehm-Demers-Weiser conservative garbage collector can 
+	  be used as a garbage collecting replacement for C 'malloc'
+	  or C++ 'new'.
+
+	  http://www.hboehm.info/gc/
+
diff --git a/package/bdwgc/bdwgc.mk b/package/bdwgc/bdwgc.mk
new file mode 100644
index 0000000..a687cc2
--- /dev/null
+++ b/package/bdwgc/bdwgc.mk
@@ -0,0 +1,19 @@
+################################################################################
+#
+# bdwgc
+#
+################################################################################
+
+BDWGC_VERSION = 7.2f
+BDWGC_SOURCE  = gc-$(BDWGC_VERSION).tar.gz
+BDWGC_SITE    = http://www.hboehm.info/gc/gc_source
+BDWGC_INSTALL_STAGING = YES
+BDWGC_LICENSE = bdwgc license
+BDWGC_LICENSE_FILES = README
+BDWGC_LIBTOOL_PATCH = NO
+
+BDWGC_DEPENDENCIES = host-bdwgc libatomic_ops
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
+
-- 
1.9.1

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

* [Buildroot] [PATCH v2 3/4] libunistring: Add host-autotools-package
  2014-11-03  0:34 [Buildroot] [PATCH v2 0/4] package/guile: New package Pedro Aguilar
  2014-11-03  0:34 ` [Buildroot] [PATCH v2 1/4] libatomic_ops: Add host-autotools-package Pedro Aguilar
  2014-11-03  0:34 ` [Buildroot] [PATCH v2 2/4] bdwgc: new package Pedro Aguilar
@ 2014-11-03  0:34 ` Pedro Aguilar
  2014-11-03  0:34 ` [Buildroot] [PATCH v2 4/4] guile: new package Pedro Aguilar
  3 siblings, 0 replies; 9+ messages in thread
From: Pedro Aguilar @ 2014-11-03  0:34 UTC (permalink / raw)
  To: buildroot

The host-libunistring is needed by guile

Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>

---
Changes v1 -> v2:
- Add host-libunistring (suggested by Yann Morin)

Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
---
 package/libunistring/libunistring.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/libunistring/libunistring.mk b/package/libunistring/libunistring.mk
index 3234ddc..fd77d12 100644
--- a/package/libunistring/libunistring.mk
+++ b/package/libunistring/libunistring.mk
@@ -17,3 +17,4 @@ LIBUNISTRING_CONF_OPTS += --disable-threads
 endif
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
-- 
1.9.1

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

* [Buildroot] [PATCH v2 4/4] guile: new package
  2014-11-03  0:34 [Buildroot] [PATCH v2 0/4] package/guile: New package Pedro Aguilar
                   ` (2 preceding siblings ...)
  2014-11-03  0:34 ` [Buildroot] [PATCH v2 3/4] libunistring: Add host-autotools-package Pedro Aguilar
@ 2014-11-03  0:34 ` Pedro Aguilar
  2014-11-03  7:29   ` Thomas Petazzoni
  3 siblings, 1 reply; 9+ messages in thread
From: Pedro Aguilar @ 2014-11-03  0:34 UTC (permalink / raw)
  To: buildroot

Guile is an interpreter and compiler for the Scheme programming
language, a clean and elegant dialect of Lisp.

Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>

---
Changes v1 -> v2:
- Add all needed dependencies
- Explain GUILE_CONF_ENV arguments
- Remove PKG_CONFIG_HOST_BINARY
- Fix patches formatting
- Add thread comments in Config.in
(All changes suggested by Yann Morin)

Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
---
 package/Config.in                                  |  1 +
 package/guile/Config.in                            | 17 ++++++++++++
 package/guile/guile-01-fix_arm_endianness.patch    | 19 +++++++++++++
 .../guile/guile-02-calculate-csqrt_manually.patch  | 17 ++++++++++++
 .../guile-03-undef_use_gnu_local_locale_api.patch  | 16 +++++++++++
 package/guile/guile.mk                             | 32 ++++++++++++++++++++++
 6 files changed, 102 insertions(+)
 create mode 100644 package/guile/Config.in
 create mode 100644 package/guile/guile-01-fix_arm_endianness.patch
 create mode 100644 package/guile/guile-02-calculate-csqrt_manually.patch
 create mode 100644 package/guile/guile-03-undef_use_gnu_local_locale_api.patch
 create mode 100644 package/guile/guile.mk

diff --git a/package/Config.in b/package/Config.in
index bb158b4..d16c155 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -393,6 +393,7 @@ endmenu
 menu "Interpreter languages and scripting"
 	source "package/enscript/Config.in"
 	source "package/erlang/Config.in"
+	source "package/guile/Config.in"
 	source "package/haserl/Config.in"
 	source "package/jamvm/Config.in"
 	source "package/jimtcl/Config.in"
diff --git a/package/guile/Config.in b/package/guile/Config.in
new file mode 100644
index 0000000..018fbab
--- /dev/null
+++ b/package/guile/Config.in
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_GUILE
+	bool "guile"
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_PACKAGE_LIBUNISTRING
+	select BR2_PACKAGE_LIBFFI
+	select BR2_PACKAGE_GMP
+	select BR2_PACKAGE_BDWGC
+	select BR2_PACKAGE_FLEX
+	select BR2_PACKAGE_LIBTOOL
+	help
+	  Guile is an interpreter and compiler for the Scheme 
+	  programming language, a clean and elegant dialect of Lisp.
+
+	  http://www.gnu.org/software/guile
+
+	comment "guile needs a toolchain w/ threads"
+	  depends on !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/guile/guile-01-fix_arm_endianness.patch b/package/guile/guile-01-fix_arm_endianness.patch
new file mode 100644
index 0000000..f3a2092
--- /dev/null
+++ b/package/guile/guile-01-fix_arm_endianness.patch
@@ -0,0 +1,19 @@
+Fix support for ARM endianness, otherwise it gives the error 
+"unknown CPU endianness"
+
+Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
+
+diff -Nau guile-2.0.11.orig/module/system/base/target.scm guile-2.0.11/module/system/base/target.scm
+--- guile-2.0.11.orig/module/system/base/target.scm	2013-02-28 09:42:45.000000000 +0100
++++ guile-2.0.11/module/system/base/target.scm	2014-11-01 21:23:15.301242749 +0100
+@@ -70,7 +70,9 @@
+             ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
+                            "mips" "mips64"))
+              (endianness big))
+-            ((string-match "^arm.*el" cpu)
++            ((string-match "^arm.*eb" cpu)
++             (endianness big))
++            ((string-match "^arm.*" cpu)
+              (endianness little))
+             (else
+              (error "unknown CPU endianness" cpu)))))
diff --git a/package/guile/guile-02-calculate-csqrt_manually.patch b/package/guile/guile-02-calculate-csqrt_manually.patch
new file mode 100644
index 0000000..c56963b
--- /dev/null
+++ b/package/guile/guile-02-calculate-csqrt_manually.patch
@@ -0,0 +1,17 @@
+Calculate manually the sqrt() since scm_from_complex_double() gives an error
+on ARM using uclibc.
+
+Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
+
+diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c
+--- guile-2.0.11.orig/libguile/numbers.c	2014-03-12 14:24:54.000000000 +0100
++++ guile-2.0.11/libguile/numbers.c	2014-11-01 21:07:20.301263587 +0100
+@@ -10260,8 +10260,6 @@
+     {
+ #if defined HAVE_COMPLEX_DOUBLE && defined HAVE_USABLE_CSQRT	\
+       && defined SCM_COMPLEX_VALUE
+-      return scm_from_complex_double (csqrt (SCM_COMPLEX_VALUE (z)));
+-#else
+       double re = SCM_COMPLEX_REAL (z);
+       double im = SCM_COMPLEX_IMAG (z);
+       return scm_c_make_polar (sqrt (hypot (re, im)),
diff --git a/package/guile/guile-03-undef_use_gnu_local_locale_api.patch b/package/guile/guile-03-undef_use_gnu_local_locale_api.patch
new file mode 100644
index 0000000..b8ac7c3
--- /dev/null
+++ b/package/guile/guile-03-undef_use_gnu_local_locale_api.patch
@@ -0,0 +1,16 @@
+Undef USE_GNU_LOCALE_API since it's not mandatory.
+
+Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
+
+diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c
+--- guile-2.0.11.orig/libguile/i18n.c	2014-01-21 22:25:11.000000000 +0100
++++ guile-2.0.11/libguile/i18n.c	2014-11-01 21:59:29.001195319 +0100
+@@ -54,7 +54,7 @@
+    Specifications Issue 7'' (aka. "POSIX 2008"):
+ 
+      http://www.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html  */
+-# define USE_GNU_LOCALE_API
++# undef USE_GNU_LOCALE_API
+ #endif
+ 
+ #include "libguile/posix.h"  /* for `scm_i_locale_mutex' */
diff --git a/package/guile/guile.mk b/package/guile/guile.mk
new file mode 100644
index 0000000..1cc9f2f
--- /dev/null
+++ b/package/guile/guile.mk
@@ -0,0 +1,32 @@
+################################################################################
+#
+# guile
+#
+################################################################################
+
+GUILE_VERSION = 2.0.11
+GUILE_SOURCE  = guile-$(GUILE_VERSION).tar.xz
+GUILE_SITE    = ftp://ftp.gnu.org/pub/gnu/guile
+GUILE_INSTALL_STAGING = YES
+GUILE_LICENSE = LGPLv3+
+GUILE_LICENSE_FILES = LICENSE COPYING COPYING.LESSER
+GUILE_DEPENDENCIES = host-guile libunistring libffi gmp bdwgc flex libtool
+
+HOST_GUILE_DEPENDENCIES = host-intltool host-libunistring host-libffi host-gmp host-bdwgc host-flex host-libtool
+
+# We need to specify libffi and bdwgc CFLAGS and LIBS since guile's configure
+# script does not find them.
+# The HAVE_GC* CFLAGS specify that we wil use internal callbacks instead 
+# of the ones provided by bdwgc. Eg. HAVE_GC_SET_FINALIZER_NOTIFIER specifies 
+# that we won't use bdwgc's GC_finalizer_notifier callback.
+# Trying to use these specific bdwgc's callbacks breaks guile's building.
+GUILE_CONF_ENV += GUILE_FOR_BUILD=$(HOST_DIR)/usr/bin/guile \
+	LIBFFI_CFLAGS="-I$(TARGET_DIR)/usr/include" \
+	LIBFFI_LIBS="-L$(TARGET_DIR)/usr/lib -lffi" \
+	BDW_GC_CFLAGS="-I$(TARGET_DIR)/usr/include" \
+	BDW_GC_LIBS="-L$(TARGET_DIR)/usr/lib -lgc" \
+	CFLAGS+="-DHAVE_GC_SET_FINALIZER_NOTIFIER -DHAVE_GC_GET_HEAP_USAGE_SAFE -DHAVE_GC_GET_FREE_SPACE_DIVISOR -DHAVE_GC_SET_FINALIZE_ON_DEMAND"
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
+
-- 
1.9.1

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

* [Buildroot] [PATCH v2 4/4] guile: new package
  2014-11-03  0:34 ` [Buildroot] [PATCH v2 4/4] guile: new package Pedro Aguilar
@ 2014-11-03  7:29   ` Thomas Petazzoni
  2014-11-04  0:04     ` Pedro Aguilar
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2014-11-03  7:29 UTC (permalink / raw)
  To: buildroot

Dear Pedro Aguilar,

On Mon,  3 Nov 2014 01:34:11 +0100, Pedro Aguilar wrote:
> Guile is an interpreter and compiler for the Scheme programming
> language, a clean and elegant dialect of Lisp.
> 
> Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>

Thanks for this contribution! A few comments below.

> diff --git a/package/guile/Config.in b/package/guile/Config.in
> new file mode 100644
> index 0000000..018fbab
> --- /dev/null
> +++ b/package/guile/Config.in
> @@ -0,0 +1,17 @@
> +config BR2_PACKAGE_GUILE
> +	bool "guile"
> +	depends on BR2_TOOLCHAIN_HAS_THREADS
> +	select BR2_PACKAGE_LIBUNISTRING
> +	select BR2_PACKAGE_LIBFFI
> +	select BR2_PACKAGE_GMP
> +	select BR2_PACKAGE_BDWGC
> +	select BR2_PACKAGE_FLEX
> +	select BR2_PACKAGE_LIBTOOL

Are sure you really need flex and libtool on the target?

> +	help
> +	  Guile is an interpreter and compiler for the Scheme 
> +	  programming language, a clean and elegant dialect of Lisp.
> +
> +	  http://www.gnu.org/software/guile
> +
> +	comment "guile needs a toolchain w/ threads"
> +	  depends on !BR2_TOOLCHAIN_HAS_THREADS

No indentation for the "comment" line, and indentation of one tab for
the "depends on" line.

> diff --git a/package/guile/guile-01-fix_arm_endianness.patch b/package/guile/guile-01-fix_arm_endianness.patch
> new file mode 100644
> index 0000000..f3a2092
> --- /dev/null
> +++ b/package/guile/guile-01-fix_arm_endianness.patch
> @@ -0,0 +1,19 @@
> +Fix support for ARM endianness, otherwise it gives the error 
> +"unknown CPU endianness"
> +
> +Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>

Can you submit this patch upstream to the guile developers? Please Cc
me when sending the patch upstream, as I know the Guile maintainer, so
seeing my name in Cc will probably make him look at the patch :)

> diff --git a/package/guile/guile-02-calculate-csqrt_manually.patch b/package/guile/guile-02-calculate-csqrt_manually.patch
> new file mode 100644
> index 0000000..c56963b
> --- /dev/null
> +++ b/package/guile/guile-02-calculate-csqrt_manually.patch
> @@ -0,0 +1,17 @@
> +Calculate manually the sqrt() since scm_from_complex_double() gives an error
> +on ARM using uclibc.
> +
> +Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
> +
> +diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c
> +--- guile-2.0.11.orig/libguile/numbers.c	2014-03-12 14:24:54.000000000 +0100
> ++++ guile-2.0.11/libguile/numbers.c	2014-11-01 21:07:20.301263587 +0100
> +@@ -10260,8 +10260,6 @@
> +     {
> + #if defined HAVE_COMPLEX_DOUBLE && defined HAVE_USABLE_CSQRT	\
> +       && defined SCM_COMPLEX_VALUE
> +-      return scm_from_complex_double (csqrt (SCM_COMPLEX_VALUE (z)));
> +-#else
> +       double re = SCM_COMPLEX_REAL (z);
> +       double im = SCM_COMPLEX_IMAG (z);
> +       return scm_c_make_polar (sqrt (hypot (re, im)),

It would be good to have an upstreamable version of this. Since uClibc
doesn't implement C99 complex math, I believe HAVE_USABLE_CSQRT should
be false. Can you check why it isn't the case?

> diff --git a/package/guile/guile-03-undef_use_gnu_local_locale_api.patch b/package/guile/guile-03-undef_use_gnu_local_locale_api.patch
> new file mode 100644
> index 0000000..b8ac7c3
> --- /dev/null
> +++ b/package/guile/guile-03-undef_use_gnu_local_locale_api.patch
> @@ -0,0 +1,16 @@
> +Undef USE_GNU_LOCALE_API since it's not mandatory.
> +
> +Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
> +
> +diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c
> +--- guile-2.0.11.orig/libguile/i18n.c	2014-01-21 22:25:11.000000000 +0100
> ++++ guile-2.0.11/libguile/i18n.c	2014-11-01 21:59:29.001195319 +0100
> +@@ -54,7 +54,7 @@
> +    Specifications Issue 7'' (aka. "POSIX 2008"):
> + 
> +      http://www.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html  */
> +-# define USE_GNU_LOCALE_API
> ++# undef USE_GNU_LOCALE_API

Can you explain a bit more? Again, our goal is to have patches that can
potentially be accepted by the upstream project.

> diff --git a/package/guile/guile.mk b/package/guile/guile.mk
> new file mode 100644
> index 0000000..1cc9f2f
> --- /dev/null
> +++ b/package/guile/guile.mk
> @@ -0,0 +1,32 @@
> +################################################################################
> +#
> +# guile
> +#
> +################################################################################
> +
> +GUILE_VERSION = 2.0.11
> +GUILE_SOURCE  = guile-$(GUILE_VERSION).tar.xz
> +GUILE_SITE    = ftp://ftp.gnu.org/pub/gnu/guile

Use $(BR2_GNU_MIRROR)

Also, do not align the '=' signs.

> +GUILE_INSTALL_STAGING = YES
> +GUILE_LICENSE = LGPLv3+
> +GUILE_LICENSE_FILES = LICENSE COPYING COPYING.LESSER
> +GUILE_DEPENDENCIES = host-guile libunistring libffi gmp bdwgc flex libtool

So really flex and libtool needed on the target?

> +HOST_GUILE_DEPENDENCIES = host-intltool host-libunistring host-libffi host-gmp host-bdwgc host-flex host-libtool

You need intltool for the host variant but not for the target onbe?

> +
> +# We need to specify libffi and bdwgc CFLAGS and LIBS since guile's configure
> +# script does not find them.
> +# The HAVE_GC* CFLAGS specify that we wil use internal callbacks instead 
> +# of the ones provided by bdwgc. Eg. HAVE_GC_SET_FINALIZER_NOTIFIER specifies 
> +# that we won't use bdwgc's GC_finalizer_notifier callback.
> +# Trying to use these specific bdwgc's callbacks breaks guile's building.
> +GUILE_CONF_ENV += GUILE_FOR_BUILD=$(HOST_DIR)/usr/bin/guile \
> +	LIBFFI_CFLAGS="-I$(TARGET_DIR)/usr/include" \
> +	LIBFFI_LIBS="-L$(TARGET_DIR)/usr/lib -lffi" \
> +	BDW_GC_CFLAGS="-I$(TARGET_DIR)/usr/include" \
> +	BDW_GC_LIBS="-L$(TARGET_DIR)/usr/lib -lgc" \

Do, pointing to $(TARGET_DIR) for headers and libraries is not the
correct thing to do. You should point to $(STAGING_DIR) instead.

However, passing -L$(STAGING_DIR)/usr/lib or
-I$(STAGING_DIR)/usr/include is unnecessary since the Buildroot
cross-compiler already looks there for libraries/headers by default.

> +	CFLAGS+="-DHAVE_GC_SET_FINALIZER_NOTIFIER -DHAVE_GC_GET_HEAP_USAGE_SAFE -DHAVE_GC_GET_FREE_SPACE_DIVISOR -DHAVE_GC_SET_FINALIZE_ON_DEMAND"

Nope, you override the CFLAGS passed by Buildroot here. You should
instead do:

	CFLAGS="$(TARGET_CFLAGS) -foo -bar -baz"


> +$(eval $(autotools-package))
> +$(eval $(host-autotools-package))

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 2/4] bdwgc: new package
  2014-11-03  0:34 ` [Buildroot] [PATCH v2 2/4] bdwgc: new package Pedro Aguilar
@ 2014-11-03 21:24   ` Arnout Vandecappelle
  2014-11-04  0:14     ` Pedro Aguilar
  0 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2014-11-03 21:24 UTC (permalink / raw)
  To: buildroot

On 03/11/14 01:34, Pedro Aguilar wrote:
> bdwgc is a garbage collector for C and C++. The Boehm-Demers-Weiser
> conservative garbage collector can be used as a garbage collecting
> replacement for C 'malloc' or C++ 'new'.
> 
> Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
> 
> ---
> Changes v1 -> v2
> - Add external default dependency on libatomic_ops
> - Fix several formatting issues
> (All changes suggested by Yann Morin)
> 
> Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
> ---
>  package/Config.in       |  1 +
>  package/bdwgc/Config.in | 11 +++++++++++
>  package/bdwgc/bdwgc.mk  | 19 +++++++++++++++++++
>  3 files changed, 31 insertions(+)
>  create mode 100644 package/bdwgc/Config.in
>  create mode 100644 package/bdwgc/bdwgc.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index 3b3c372..bb158b4 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -942,6 +942,7 @@ endmenu
>  menu "Miscellaneous"
>  	source "package/aespipe/Config.in"
>  	source "package/bc/Config.in"
> +	source "package/bdwgc/Config.in"

 This is a library, right? So doesn't it belong under Libraries/Other rather
than here?

>  	source "package/clamav/Config.in"
>  	source "package/collectd/Config.in"
>  	source "package/empty/Config.in"
> diff --git a/package/bdwgc/Config.in b/package/bdwgc/Config.in
> new file mode 100644
> index 0000000..6f3878e
> --- /dev/null
> +++ b/package/bdwgc/Config.in
> @@ -0,0 +1,11 @@
> +config BR2_PACKAGE_BDWGC
> +	bool "bdwgc"
> +	depends on BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS
> +	select BR2_PACKAGE_LIBATOMIC_OPS
> +	help
> +	  The Boehm-Demers-Weiser conservative garbage collector can 
> +	  be used as a garbage collecting replacement for C 'malloc'
> +	  or C++ 'new'.
> +
> +	  http://www.hboehm.info/gc/
> +
> diff --git a/package/bdwgc/bdwgc.mk b/package/bdwgc/bdwgc.mk
> new file mode 100644
> index 0000000..a687cc2
> --- /dev/null
> +++ b/package/bdwgc/bdwgc.mk
> @@ -0,0 +1,19 @@
> +################################################################################
> +#
> +# bdwgc
> +#
> +################################################################################
> +
> +BDWGC_VERSION = 7.2f
> +BDWGC_SOURCE  = gc-$(BDWGC_VERSION).tar.gz
> +BDWGC_SITE    = http://www.hboehm.info/gc/gc_source
> +BDWGC_INSTALL_STAGING = YES
> +BDWGC_LICENSE = bdwgc license
> +BDWGC_LICENSE_FILES = README

 Does the readme contain all the information of that license mess or are there
additional files?

> +BDWGC_LIBTOOL_PATCH = NO

 There should be a comment explaining why this is necessary.


 Regards,
 Arnout

> +
> +BDWGC_DEPENDENCIES = host-bdwgc libatomic_ops
> +
> +$(eval $(autotools-package))
> +$(eval $(host-autotools-package))
> +
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

* [Buildroot] [PATCH v2 4/4] guile: new package
  2014-11-03  7:29   ` Thomas Petazzoni
@ 2014-11-04  0:04     ` Pedro Aguilar
  0 siblings, 0 replies; 9+ messages in thread
From: Pedro Aguilar @ 2014-11-04  0:04 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Thanks for your comments and support.

I've already fixed Config.in and guile.mk.

Regarding the guile patches:


On 03/11/2014 08:29, Thomas Petazzoni wrote:
> Dear Pedro Aguilar,
>
> On Mon,  3 Nov 2014 01:34:11 +0100, Pedro Aguilar wrote:
>> diff --git a/package/guile/guile-01-fix_arm_endianness.patch b/package/guile/guile-01-fix_arm_endianness.patch
>> new file mode 100644
>> index 0000000..f3a2092
>> --- /dev/null
>> +++ b/package/guile/guile-01-fix_arm_endianness.patch
>> @@ -0,0 +1,19 @@
>> +Fix support for ARM endianness, otherwise it gives the error
>> +"unknown CPU endianness"
>> +
>> +Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
>
> Can you submit this patch upstream to the guile developers? Please Cc
> me when sending the patch upstream, as I know the Guile maintainer, so
> seeing my name in Cc will probably make him look at the patch :)

I just noticed that this is already fixed in their git repo, so I 
changed the patch that reflects their fix.

>> diff --git a/package/guile/guile-02-calculate-csqrt_manually.patch b/package/guile/guile-02-calculate-csqrt_manually.patch
>> new file mode 100644
>> index 0000000..c56963b
>> --- /dev/null
>> +++ b/package/guile/guile-02-calculate-csqrt_manually.patch
>> @@ -0,0 +1,17 @@
>> +Calculate manually the sqrt() since scm_from_complex_double() gives an error
>> +on ARM using uclibc.
>> +
>> +Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
>> +
>> +diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c
>> +--- guile-2.0.11.orig/libguile/numbers.c	2014-03-12 14:24:54.000000000 +0100
>> ++++ guile-2.0.11/libguile/numbers.c	2014-11-01 21:07:20.301263587 +0100
>> +@@ -10260,8 +10260,6 @@
>> +     {
>> + #if defined HAVE_COMPLEX_DOUBLE && defined HAVE_USABLE_CSQRT	\
>> +       && defined SCM_COMPLEX_VALUE
>> +-      return scm_from_complex_double (csqrt (SCM_COMPLEX_VALUE (z)));
>> +-#else
>> +       double re = SCM_COMPLEX_REAL (z);
>> +       double im = SCM_COMPLEX_IMAG (z);
>> +       return scm_c_make_polar (sqrt (hypot (re, im)),
>
> It would be good to have an upstreamable version of this. Since uClibc
> doesn't implement C99 complex math, I believe HAVE_USABLE_CSQRT should
> be false. Can you check why it isn't the case?

They only use HAVE_USABLE_CSQRT because of a bug in old glibc versions 
and they set it to 1 if this bug is not present. Since uclibc doesn't 
have this bug, HAVE_USABLE_CSQRT is always 1.
I modified configure.ac and if we're cross-compiling, it sets 
HAVE_USABLE_CSQRT to 0. This would be a safe default since disabling 
this define doesn't break anything:

diff -Nau guile-2.0.11.orig/configure.ac guile-2.0.11/configure.ac
--- guile-2.0.11.orig/configure.ac  2014-03-12 14:36:02.000000000 +0100
+++ guile-2.0.11/configure.ac   2014-11-03 23:59:51.897267207 +0100
@@ -862,7 +862,7 @@
  }]])],
      [guile_cv_use_csqrt=yes],
      [guile_cv_use_csqrt="no, glibc 2.3 bug"],
-    [guile_cv_use_csqrt="yes, hopefully (cross-compiling)"])])
+    [guile_cv_use_csqrt="no (cross-compiling)"])])
    case $guile_cv_use_csqrt in
      yes*)
        AC_DEFINE([HAVE_USABLE_CSQRT], 1, [Define to 1 if csqrt is 
bug-free])

>> diff --git a/package/guile/guile-03-undef_use_gnu_local_locale_api.patch b/package/guile/guile-03-undef_use_gnu_local_locale_api.patch
>> new file mode 100644
>> index 0000000..b8ac7c3
>> --- /dev/null
>> +++ b/package/guile/guile-03-undef_use_gnu_local_locale_api.patch
>> @@ -0,0 +1,16 @@
>> +Undef USE_GNU_LOCALE_API since it's not mandatory.
>> +
>> +Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
>> +
>> +diff -Nau guile-2.0.11.orig/libguile/i18n.c guile-2.0.11/libguile/i18n.c
>> +--- guile-2.0.11.orig/libguile/i18n.c	2014-01-21 22:25:11.000000000 +0100
>> ++++ guile-2.0.11/libguile/i18n.c	2014-11-01 21:59:29.001195319 +0100
>> +@@ -54,7 +54,7 @@
>> +    Specifications Issue 7'' (aka. "POSIX 2008"):
>> +
>> +      http://www.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html  */
>> +-# define USE_GNU_LOCALE_API
>> ++# undef USE_GNU_LOCALE_API
>
> Can you explain a bit more? Again, our goal is to have patches that can
> potentially be accepted by the upstream project.

With this patch I avoid the compilation error 'dereferencing pointer to 
incomplete type' caused by an alias for glibc's locale type.
Since guile works fine without this define, may be the proper patch 
would be to enable/disable it according to the used library (glib, 
uclibc, ...) although I'm not sure how to do this at 'configure' time.

Do you have any suggestion or different ideas?

Thanks!

-- 
Pedro Aguilar
http://paguilar.org

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

* [Buildroot] [PATCH v2 2/4] bdwgc: new package
  2014-11-03 21:24   ` Arnout Vandecappelle
@ 2014-11-04  0:14     ` Pedro Aguilar
  0 siblings, 0 replies; 9+ messages in thread
From: Pedro Aguilar @ 2014-11-04  0:14 UTC (permalink / raw)
  To: buildroot

Hi Arnout,

On 03/11/2014 22:24, Arnout Vandecappelle wrote:
> On 03/11/14 01:34, Pedro Aguilar wrote:
>> bdwgc is a garbage collector for C and C++. The Boehm-Demers-Weiser
>> conservative garbage collector can be used as a garbage collecting
>> replacement for C 'malloc' or C++ 'new'.
>>
>> Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
>>
>> ---
>> Changes v1 -> v2
>> - Add external default dependency on libatomic_ops
>> - Fix several formatting issues
>> (All changes suggested by Yann Morin)
>>
>> Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
>> ---
>>   package/Config.in       |  1 +
>>   package/bdwgc/Config.in | 11 +++++++++++
>>   package/bdwgc/bdwgc.mk  | 19 +++++++++++++++++++
>>   3 files changed, 31 insertions(+)
>>   create mode 100644 package/bdwgc/Config.in
>>   create mode 100644 package/bdwgc/bdwgc.mk
>>
>> diff --git a/package/Config.in b/package/Config.in
>> index 3b3c372..bb158b4 100644
>> --- a/package/Config.in
>> +++ b/package/Config.in
>> @@ -942,6 +942,7 @@ endmenu
>>   menu "Miscellaneous"
>>   	source "package/aespipe/Config.in"
>>   	source "package/bc/Config.in"
>> +	source "package/bdwgc/Config.in"
>
>   This is a library, right? So doesn't it belong under Libraries/Other rather
> than here?

Right, I'll change it.

>>   	source "package/clamav/Config.in"
>>   	source "package/collectd/Config.in"
>>   	source "package/empty/Config.in"
>> diff --git a/package/bdwgc/Config.in b/package/bdwgc/Config.in
>> new file mode 100644
>> index 0000000..6f3878e
>> --- /dev/null
>> +++ b/package/bdwgc/Config.in
>> @@ -0,0 +1,11 @@
>> +config BR2_PACKAGE_BDWGC
>> +	bool "bdwgc"
>> +	depends on BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS
>> +	select BR2_PACKAGE_LIBATOMIC_OPS
>> +	help
>> +	  The Boehm-Demers-Weiser conservative garbage collector can
>> +	  be used as a garbage collecting replacement for C 'malloc'
>> +	  or C++ 'new'.
>> +
>> +	  http://www.hboehm.info/gc/
>> +
>> diff --git a/package/bdwgc/bdwgc.mk b/package/bdwgc/bdwgc.mk
>> new file mode 100644
>> index 0000000..a687cc2
>> --- /dev/null
>> +++ b/package/bdwgc/bdwgc.mk
>> @@ -0,0 +1,19 @@
>> +################################################################################
>> +#
>> +# bdwgc
>> +#
>> +################################################################################
>> +
>> +BDWGC_VERSION = 7.2f
>> +BDWGC_SOURCE  = gc-$(BDWGC_VERSION).tar.gz
>> +BDWGC_SITE    = http://www.hboehm.info/gc/gc_source
>> +BDWGC_INSTALL_STAGING = YES
>> +BDWGC_LICENSE = bdwgc license
>> +BDWGC_LICENSE_FILES = README
>
>   Does the readme contain all the information of that license mess or are there
> additional files?

No, it's only this file.

>> +BDWGC_LIBTOOL_PATCH = NO
>
>   There should be a comment explaining why this is necessary.

I had a building issue. I'll comment it in the following patch set.

Thanks for the feedback.

-- 
Pedro Aguilar
http://paguilar.org

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

end of thread, other threads:[~2014-11-04  0:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03  0:34 [Buildroot] [PATCH v2 0/4] package/guile: New package Pedro Aguilar
2014-11-03  0:34 ` [Buildroot] [PATCH v2 1/4] libatomic_ops: Add host-autotools-package Pedro Aguilar
2014-11-03  0:34 ` [Buildroot] [PATCH v2 2/4] bdwgc: new package Pedro Aguilar
2014-11-03 21:24   ` Arnout Vandecappelle
2014-11-04  0:14     ` Pedro Aguilar
2014-11-03  0:34 ` [Buildroot] [PATCH v2 3/4] libunistring: Add host-autotools-package Pedro Aguilar
2014-11-03  0:34 ` [Buildroot] [PATCH v2 4/4] guile: new package Pedro Aguilar
2014-11-03  7:29   ` Thomas Petazzoni
2014-11-04  0:04     ` Pedro Aguilar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox