Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 507156 - dev-scheme/guile-1.8.8-r1 USE=threads - configure: error: cannot run test program while cross compiling
Summary: dev-scheme/guile-1.8.8-r1 USE=threads - configure: error: cannot run test pro...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Scheme Project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-04-08 16:38 UTC by Hristo Venev
Modified: 2018-02-12 19:26 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hristo Venev 2014-04-08 16:38:38 UTC
dev-scheme/guile-1.8.8-r1

checking whether pthread_attr_getstack works for the main thread... configure: error: in `/var/tmp/portage/dev-scheme/guile-1.8.8-r1/work/guile-1.8.8':
configure: error: cannot run test program while cross compiling
See `config.log' for more details

Reproducible: Always
Comment 1 Jeroen Roovers gentoo-dev 2014-04-08 18:37:33 UTC
1) Please post your `emerge --info' output in a comment.
2) Please attach the entire build log to this bug report.
3) Please attach the config.log to this bug report.
Comment 2 Hristo Venev 2014-04-08 19:37:44 UTC
1) Relevant:
USE="threads"
2) Relevant:
checking whether pthread_attr_getstack works for the main thread... configure: error: in `/var/tmp/portage/dev-scheme/guile-1.8.8-r1/work/guile-1.8.8':
configure: error: cannot run test program while cross compiling
See `config.log' for more details
3) Irrelevant

Relevant: configure.in:1374:
AC_RUN_IFELSE([AC_LANG_SOURCE([[
... Skip 25 lines
]])],
[works=yes
AC_DEFINE(PTHREAD_ATTR_GETSTACK_WORKS, [1], [Define when pthread_att_get_stack works for the main thread])],
[works=no],
[])

This is only run if guile is built with pthreads support.

The fourth argument is [] which is the empty string. If the fourth argument of AC_RUN_IFELSE is empty it's replaced with [AC_MSG_FAILURE([cannot run test program while cross compiling])].

If cross-compiling, all AC_RUN_IFELSE evaluate their fourth argument, which in this case is [AC_MSG_FAILURE([cannot run test program while cross compiling])]. Therefore dev-scheme/guile-1.8.8-r1 does not cross-compile with USE="threads".

Possible fix:
Set the fourth argument of AC_RUN_IFELSE on line 1374 to something other than [], such as the second argument.

--- a/configure.in
+++ b/configure.in
@@ -1400,7 +1400,8 @@
 [works=yes
 AC_DEFINE(PTHREAD_ATTR_GETSTACK_WORKS, [1], [Define when pthread_att_get_stack works for the main thread])],
 [works=no],
-[])
+[works=yes
+AC_DEFINE(PTHREAD_ATTR_GETSTACK_WORKS, [1], [Define when pthread_att_get_stack works for the main thread])])
 CFLAGS="$old_CFLAGS"
 AC_MSG_RESULT($works)
Comment 3 Matt Whitlock 2015-03-22 20:54:04 UTC
The patch in Comment 2 fixes the build for me when cross-compiling on x86_64-pc-linux-gnu for armv6j-hardfloat-linux-gnueabi.