[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#971559: marked as done (coinor-cgl FTCBFS: doesn't build shared libraries)



Your message dated Sat, 04 Sep 2021 03:03:28 +0000
with message-id <E1mMLxo-000CRU-8e@fasolo.debian.org>
and subject line Bug#971559: fixed in coinor-cgl 0.60.3+repack1-3
has caused the Debian Bug report #971559,
regarding coinor-cgl FTCBFS: doesn't build shared libraries
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
971559: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=971559
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: coinor-cgl
Version: 0.60.3+repack1-3
Tags: patch upstream
User: debian-cross@lists.debian.org
Usertags: ftcbfs

coinor-cgl fails to cross build from source, because it doesn't build
shared libraries and then dh_install fails. Now the reasons for that are
... a little involved. Please sit down and take a cup of coffee or tea
or like that.

Looking into the cross configure output, one can spot this:
http://crossqa.debian.net/build/coinor-cgl_0.60.3+repack1-2_s390x_20200713232329.log
> checking whether the s390x-linux-gnu-gcc linker (/usr/bin/ld -m elf64_s390) supports shared libraries... /usr/bin/ld: unrecognised emulation mode: elf64_s390
> Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe
> no

Bummer. It's using the wrong ld. It should be using s390x-linux-gnu-ld.
Why does it do that? It should be driving the ld name from gcc. However,
it only does when working with a GNU compiler and as we can see:

> checking whether we are using the GNU C compiler... no

For some reason, it concludes that gcc is not a GNU C compiler. That's
strange. You can also see this in native builds and it can have a range
of misdetections as a consequence. Just why?

The actual sequence of events is this:

We start following inside AC_COIN_DEBUG_COMPILE.

> checking whether we want to compile in debug mode... no

Now we're moving inside AC_COIN_PROG_CC executing AC_REQUIREd code.

> checking for s390x-linux-gnu-gcc... s390x-linux-gnu-gcc

At this point $ac_objext is not yet computed, so it is empty. What we do
next is use AC_TRY_COMPILE and that checks whether "conftest.$ac_objext"
aka "conftest." is non-empty. It isn't, as the compiler chose to output
to "conftest.o" instead, so we're not using a GNU compiler, right?

> checking whether we are using the GNU C compiler... no
> checking whether s390x-linux-gnu-gcc accepts -g... no
> checking for s390x-linux-gnu-gcc option to accept ISO C89... unsupported
> checking whether s390x-linux-gnu-gcc understands -c and -o together... yes

Now we've completed the AC_REQUIREd stuff and proceed to the AC_PROG_CC
inside AC_COIN_PROG_CC.

> checking for s390x-linux-gnu-gcc... s390x-linux-gnu-gcc
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... yes

This time we compute $ac_cv_objext, which is propagated to $ac_objext.

> checking for suffix of object files... o

But we already checked that we're not using a GNU C compiler, so we
don't check again. If we were checking again, we'd now see that it is a
GNU C compiler as AC_TRY_COMPILE would now check for "conftest.o".

> checking whether we are using the GNU C compiler... (cached) no

The order of invocations is messed up. The basic structure of
AC_COIN_PROG_CC is:

    AC_REQUIRE([AC_COIN_ENABLE_MSVC])
    ...
    AC_PROG_CC([$comps])
    ...
    AC_TRY_LINK(...)

Unfortunately, the AC_TRY_LINK AC_REQUIREs AC_PROG_CC, so that gets
executed before AC_COIN_PROG_CC gets a chance to compute $comps for
AC_PROG_CC. The issue is that we're using AC_TRY_LINK in the same defun
as we call AC_PROG_CC. That doesn't work.

Once understood, the solution is quite simple. We must put the
AC_PROG_CC and the AC_TRY_LINK in different defuns and ensure that our
intended AC_PROG_CC is AC_REQUIREd before using AC_TRY_LINK. I'm
attaching a patch to do that. Please consider applying it. I believe
that this is worth fixing even if you don't care about cross builds.

Helmut
--- coinor-cgl-0.60.3+repack1.orig/BuildTools/coin.m4
+++ coinor-cgl-0.60.3+repack1/BuildTools/coin.m4
@@ -665,9 +665,8 @@ AC_LANG_POP(C++)
 # given my the user), and find an appropriate value for CFLAGS.  It is
 # possible to provide additional -D flags in the variable CDEFS.
 
-AC_DEFUN([AC_COIN_PROG_CC],
-[AC_REQUIRE([AC_COIN_ENABLE_MSVC])
-AC_LANG_PUSH(C)
+AC_DEFUN([AC_COIN_PROG_CC_HEAD],
+[
 
 # For consistency, we set the C compiler to the same value of the C++
 # compiler, if the C++ is set, but the C compiler isn't (only for CXX=cl)
@@ -726,6 +725,13 @@ AC_PROG_CC([$comps])
 if test -z "$CC" ; then
   AC_MSG_ERROR([Failed to find a C compiler!])
 fi
+])
+AC_DEFUN([AC_COIN_PROG_CC],
+[AC_REQUIRE([AC_COIN_ENABLE_MSVC])
+dnl Separate the head of this macro to AC_COIN_PROG_CC_HEAD such that it
+dnl controls the invocation of AC_PROG_CC instead of the AC_TRY_LINK below.
+AC_REQUIRE([AC_COIN_PROG_CC_HEAD])
+AC_LANG_PUSH(C)
 # Autoconf incorrectly concludes that cl recognises -g. It doesn't.
 case "$CC" in
   clang* ) ;;

--- End Message ---
--- Begin Message ---
Source: coinor-cgl
Source-Version: 0.60.3+repack1-3
Done: Boyuan Yang <byang@debian.org>

We believe that the bug you reported is fixed in the latest version of
coinor-cgl, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 971559@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Boyuan Yang <byang@debian.org> (supplier of updated coinor-cgl package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 03 Sep 2021 22:38:42 -0400
Source: coinor-cgl
Architecture: source
Version: 0.60.3+repack1-3
Distribution: unstable
Urgency: medium
Maintainer: Debian QA Group <packages@qa.debian.org>
Changed-By: Boyuan Yang <byang@debian.org>
Closes: 971559 978789
Changes:
 coinor-cgl (0.60.3+repack1-3) unstable; urgency=medium
 .
   * QA upload.
 .
   [ Debian Janitor ]
   * Apply multi-arch hints.
     + coinor-libcgl1: Add Multi-Arch: same.
     + coinor-libcgl-dev: Add Multi-Arch: same.
     + coinor-libcgl-doc: Add Multi-Arch: foreign.
 .
   [ Boyuan Yang ]
   * Rebuild against autoconf 2.71. (Closes: #978789)
   * Bump Standards-Version to 4.6.0.
   * debian/upstream/metadata: Use better format.
   * debian/not-installed: Be specific on what is not installed.
   * debian/patches/cross.patch: Add patch to fix FTBFS in cross
     compilation. (Closes: #971559)
Checksums-Sha1:
 74831aa941d2c3aac52b637715121bbd38466dd6 2268 coinor-cgl_0.60.3+repack1-3.dsc
 10bedabca03086dd507bee2e1e441433ff44d1af 606960 coinor-cgl_0.60.3+repack1.orig.tar.xz
 d0ccacb320264ea7bb75a8dd7e218b8f722fcf6a 9928 coinor-cgl_0.60.3+repack1-3.debian.tar.xz
 fd2a709e3d58f2bf55fc72b309406c76fea1a6d1 8894 coinor-cgl_0.60.3+repack1-3_amd64.buildinfo
Checksums-Sha256:
 95763a868a4e3d19abd1200ef2326097d35aa758020febca0d1b6c23e9c63f8c 2268 coinor-cgl_0.60.3+repack1-3.dsc
 756f858691021c9982274ee3510b00b998a0e160f62a2a5813e1324b94418576 606960 coinor-cgl_0.60.3+repack1.orig.tar.xz
 503c9723bf1ce1a339084c986a107371fd9d987f90818c03b468578234a7d092 9928 coinor-cgl_0.60.3+repack1-3.debian.tar.xz
 e0aa6ff68a3cc42499cd54c5c231e51225fd2da1caa8dfb443206b1453f713e5 8894 coinor-cgl_0.60.3+repack1-3_amd64.buildinfo
Files:
 59bf22b55b6cb5b9e13b7653f1f0f845 2268 science optional coinor-cgl_0.60.3+repack1-3.dsc
 55efe6a8239e712c59bbbd5a187df882 606960 science optional coinor-cgl_0.60.3+repack1.orig.tar.xz
 4d5b1a8842d7ede7053e5dd6f0ad1713 9928 science optional coinor-cgl_0.60.3+repack1-3.debian.tar.xz
 4115d05a18fe61889291530418d483ec 8894 science optional coinor-cgl_0.60.3+repack1-3_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfncpR22H1vEdkazLwpPntGGCWs4FAmEy3NAACgkQwpPntGGC
Ws4shQ//X8k0WWgAZ9jLqx7j2ZSxHI6wRIYUld8OKti4zQ3jdH3nDpJu0mjmjVyI
dndjvpHhIMN8kfIl+CqB504GV0wxkGyUbo8QagE0GAbYlA9zi8DwjDhtZrtOGvSR
XdtJuWfMS1+WinpErmdppoaIn8e3euVcusGQq0p01tCqErVW8dT6fZanz1Z34rTO
0Y7CgGcp7quJbGVdEd7MWd2iGuW20ehVHc7ozP1X6XIPNm2nm/MZgZ5N/sem9zUk
wPBGDLBF1oXfRXwjPuXKmTkwFNE/ha+5zT/DFe5E8OwSLdjzvX3wdNAVy91bnJrV
qFv59JZq7m+8mzdV5s0SnW/E/26JKR1XYKTifoO6FsgT0YF+UI0BrrUj0w5aaD8q
N+b0n//4slixBPxS19PxbaiE9FYhjFcO8XCtxq0ErgxBr9WbxrBuV00eZM+wrqQv
lJqLfPT/MFPzNhBJNd3T9tcbFxV/RHK/zIGlzFYdd/5HwME1DiZvjPPd9VLXXJIQ
LjC+SsEKlm8waLRIpSrN6V3W5ARdFF5qV6BCi8HPLlO13bYXgoNaUA+klj4ZiQOu
d9UoeukSLIQ3h1Arf4ISeL40QhfXUxn3iGHrKHx//NcMk6e+BqWa8tR8Uk7nfWOW
EO+z7k05BX0Y/0HBFE134K5LvIwsvZb4dx6MxOvxMIuM6cfELWw=
=vt2A
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: