On 2015-05-26 02:43 +0200, Thomas Dickey wrote:
> ----- Original Message -----
> | From: "Sven Joachim" <[email protected]>
> | To: "Helmut Grohne" <[email protected]>
> | Cc: "Thomas Dickey" <[email protected]>, [email protected]
> | Sent: Monday, May 25, 2015 8:31:29 AM
> | Subject: Bug#786436: ncurses FTBFS: configure loops
> |
> | Am 25.05.2015 um 13:43 schrieb Helmut Grohne:
> |
> | > On Mon, May 25, 2015 at 01:37:17PM +0200, Sven Joachim wrote:
> | >> Since the pkg-config files are only created at "make
> | >> install.libs", we
> | >> currently need to install the library into a temporary location.
> | >> I've
> | >> come up with the following patch:
> | >>
> | >> --8<---------------cut here---------------start------------->8---
> | >> diff --git a/debian/rules b/debian/rules
> | >> index a52135b..c3b7d6e 100755
> | >> --- a/debian/rules
> | >> +++ b/debian/rules
> | >> @@ -275,8 +275,9 @@ $(wobjdir-32)/config.status:
> | >> config.guess-stamp
> | >>
> | >> $(objdir-test)/config.status: build-wide config.guess-stamp
> | >> test -d $(objdir-test) || mkdir $(objdir-test)
> | >> - cd $(objdir-test) && CFLAGS="$(CFLAGS)" $(srcdir)/test/configure
> | >> \
> | >> - $(CONFARGS-TEST)
> | >> + cd $(objdir-test) && CFLAGS="$(CFLAGS)" \
> | >> +
> | >>
> PKG_CONFIG_LIBDIR=$(wobjdir)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
> | >> \
> | >> + $(srcdir)/test/configure $(CONFARGS-TEST)
> | >>
> | >> build-arch build-indep: build
> | >>
> | >> @@ -308,8 +309,7 @@ build-debug: $(objdir-debug)/config.status
> | >> build-wide: $(wobjdir)/config.status
> | >> cd $(wobjdir) && $(MAKE)
> | >> # needed for building the examples
> | >> - mv $(wobjdir)/lib/libncursesw.so
> | >> $(wobjdir)/lib/libncursesw.so.saved
> | >> - echo "INPUT(libncursesw.so.5 -ltinfo)" >
> | >> $(wobjdir)/lib/libncursesw.so
> | >> + $(MAKE) -C $(wobjdir) DESTDIR=$(wobjdir) install.libs
> | >> touch $@
> | >>
> | >> build-wide-static: $(wobjdir-static)/config.status
> | >> --8<---------------cut here---------------end--------------->8---
> | >
> | > If ncurses uses any external pkg-config files, then this patch
> | > breaks
> | > cross building, because the pkg-config cross wrapper only sets
> | > PKG_CONFIG_LIBDIR when it is unset.
> | >
> | > Given that libgpm-dev does not ship a .pc file, it seems likely
> | > that
> | > this is not the case.
> |
> | It surely is not, but the cross build is broken anyway:
> |
> | ,----
> | | checking for specific curses-directory...
> | | /tmp/ncurses-5.9+20150516/obj-wide
> | | checking for specified curses library type... ncursesw
> | | checking for multibyte character support... yes
> | | checking pkg-config for ncursesw... yes
> | | checking if the ncursesw package files work... configure: error:
> | | cannot run test program while cross compiling
> | `----
> |
> | Sounds like something for Thomas to look at.
>
> This (cannot run...) at least is a problem in something I have changed
> recently.
>
> The apparent cause of the infinite loop
> (seen here by disabling the pkg-config and ncurses*-config checks)
> is a while-loop in CF_ADD_INCDIR, which has been (it seems)
> waiting since 2007 for someone to notice a problem...
The 20150530 patch fixes the "cannot run test program while cross
compiling" error, but cross-building is still broken. :-( Here is a
diff of the respective Makefiles for the test programs between the
working native amd64 build and the failing armhf cross build:
--8<---------------cut here---------------start------------->8---
--- Makefile-amd64 2015-06-02 08:41:20.237128650 +0200
+++ Makefile-armhf 2015-06-02 08:02:12.830544856 +0200
@@ -75,11 +75,11 @@
CTAGS = ctags
ETAGS = etags
-CC = gcc
-CPP = gcc -E
+CC = arm-linux-gnueabihf-gcc
+CPP = arm-linux-gnueabihf-gcc -E
CFLAGS = -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security
-CPPFLAGS = -I. -I$(srcdir) -I../test -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/tmp/ncurses-5.9+20150530/obj-wide/include -D_GNU_SOURCE
-I/usr/include/ -I/usr/include/ncursesw
+CPPFLAGS = -I. -I$(srcdir) -I../test -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/tmp/ncurses-5.9+20150530/obj-wide/include
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
@@ -109,7 +109,7 @@
LDFLAGS_PROFILE = $(LDFLAGS) $(CFLAGS_PROFILE)
LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED)
-TEST_ARGS = -lformw -lmenuw -lpanelw -lncursesw -ltinfo
+TEST_ARGS = -lformw -lmenuw -lpanelw
# use these for linking with all of the libraries
LIBS_DEFAULT = $(TEST_ARGS) $(TEST_LIBS) $(MATH_LIB)
--8<---------------cut here---------------end--------------->8---
As you can see, "-lncursesw -ltinfo" is missing, which of course leads
to unresolved symbols trying to link the programs. The following lines
from config.log seem to be relevant:
,----
| configure:6075: checking pkg-config for ncursesw
| configure:6078: result: yes
| configure:6081: checking if the ncursesw package files work
| configure:6119: arm-linux-gnueabihf-gcc -o conftest -g -O2
-fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/tmp/ncurses-5.9+20150530/obj-wide/include -D_GNU_SOURCE
-I/usr/include/ -I/usr/include/ncursesw
-L/tmp/ncurses-5.9+20150530/obj-wide/lib -Wl,-z,relro conftest.c
-L/usr/lib/arm-linux-gnueabihf -lncursesw -ltinfo >&5
| configure:6122: $? = 0
| configure:6125: test -s conftest
| configure:6128: $? = 0
| configure:6167: result: unknown
`----
The native build has this instead:
,----
| configure:6075: checking pkg-config for ncursesw
| configure:6078: result: yes
| configure:6081: checking if the ncursesw package files work
| configure:6119: gcc -o conftest -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
-I/tmp/ncurses-5.9+20150530/obj-wide/include -D_GNU_SOURCE -I/usr/include/
-I/usr/include/ncursesw -L/tmp/ncurses-5.9+20150530/obj-wide/lib -Wl,-z,relro
conftest.c -lncursesw -ltinfo >&5
| configure:6122: $? = 0
| configure:6125: test -s conftest
| configure:6128: $? = 0
| configure:6141: gcc -o conftest -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
-I/tmp/ncurses-5.9+20150530/obj-wide/include -D_GNU_SOURCE -I/usr/include/
-I/usr/include/ncursesw -L/tmp/ncurses-5.9+20150530/obj-wide/lib -Wl,-z,relro
conftest.c -lncursesw -ltinfo >&5
| configure: In function 'main':
| configure:6137:18: warning: initialization discards 'const' qualifier from
pointer target type
| configure:6144: $? = 0
| configure:6146: ./conftest
| configure:6149: $? = 0
| configure:6167: result: yes
| configure:13107: checking for new_panel in -lpanelw
`----
Cheers,
Sven
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]