GNU bug report logs - #46253
powerpc64le: gcc-final: "configure: error: cannot compute sizeof (long long)"

Previous Next

Package: guix;

Reported by: Chris Marusich <cmmarusich <at> gmail.com>

Date: Tue, 2 Feb 2021 09:08:02 UTC

Severity: normal

Done: Chris Marusich <cmmarusich <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 46253 in the body.
You can then email your comments to 46253 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to lle-bout <at> zaclys.net, efraim <at> flashner.co.il, bug-guix <at> gnu.org:
bug#46253; Package guix. (Tue, 02 Feb 2021 09:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chris Marusich <cmmarusich <at> gmail.com>:
New bug report received and forwarded. Copy sent to lle-bout <at> zaclys.net, efraim <at> flashner.co.il, bug-guix <at> gnu.org. (Tue, 02 Feb 2021 09:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Chris Marusich <cmmarusich <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: powerpc64le: gcc-final: "configure: error: cannot compute sizeof
 (long long)"
Date: Tue, 02 Feb 2021 01:07:24 -0800
[Message part 1 (text/plain, inline)]
Hi,

On powerpc64le-linux, using commit
a1cdd9de3cffb5677fc1570d9a7992bf0cbd2f34 (which is on the wip-ppc64le
branch), gcc-final fails to build with the following error:

--8<---------------cut here---------------start------------->8---
checking size of long long... configure: error: in `/tmp/guix-build-gcc-7.5.0.drv-0/build/gcc':
configure: error: cannot compute sizeof (long long)
See `config.log' for more details.
--8<---------------cut here---------------end--------------->8---

The file /tmp/guix-build-gcc-7.5.0.drv-0/build/gcc/config.log contains a
little more info.  It says:

--8<---------------cut here---------------start------------->8---
configure:6087: checking size of long long
configure:6092: g++ -std=gnu++98 -o conftest -g    -Wl,-rpath=/gnu/store/mzdwhzgk63ys7ypadfxgk1v2nh83gvwi-glibc-2.31/lib -Wl,-dynamic-linker -Wl,/gnu/store/mzdwhzgk63ys7ypadfxgk1v2nh83gvwi-glibc-2.31/lib/ld64.so.2 -L/gnu/store/4ya8f2bqqvaa0lw06zqskby6x8djcac7-libstdc++-7.5.0/lib -L/gnu/store/1lwsfgsv6ka9dljwczvjrp4rg7s150v5-zlib-1.2.11/lib -Wl,-rpath=/gnu/store/1lwsfgsv6ka9dljwczvjrp4rg7s150v5-zlib-1.2.11/lib conftest.cpp  >&5
powerpc64le-guix-linux-gnu-ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
configure:6092: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define SIZEOF_VOID_P 0
| #define SIZEOF_SHORT 0
| #define SIZEOF_INT 0
| #define SIZEOF_LONG 0
| #define HAVE_LONG_LONG 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| static long int longval () { return (long int) (sizeof (long long)); }
| static unsigned long int ulongval () { return (long int) (sizeof (long long)); }
| #include <stdio.h>
| #include <stdlib.h>
| int
| main ()
| {
| 
|   FILE *f = fopen ("conftest.val", "w");
|   if (! f)
|     return 1;
|   if (((long int) (sizeof (long long))) < 0)
|     {
|       long int i = longval ();
|       if (i != ((long int) (sizeof (long long))))
| 	return 1;
|       fprintf (f, "%ld", i);
|     }
|   else
|     {
|       unsigned long int i = ulongval ();
|       if (i != ((long int) (sizeof (long long))))
| 	return 1;
|       fprintf (f, "%lu", i);
|     }
|   /* Do not output a trailing newline, as this causes \r\n confusion
|      on some platforms.  */
|   return ferror (f) || fclose (f) != 0;
| 
|   ;
|   return 0;
| }
configure:6096: error: in `/tmp/guix-build-gcc-7.5.0.drv-0/build/gcc':
configure:6100: error: cannot compute sizeof (long long)
--8<---------------cut here---------------end--------------->8---

Any ideas?  Perhaps we need to configure gcc in a special way for
powerpc64le-linux?

-- 
Chris
[signature.asc (application/pgp-signature, inline)]

Reply sent to Chris Marusich <cmmarusich <at> gmail.com>:
You have taken responsibility. (Thu, 04 Feb 2021 08:28:02 GMT) Full text and rfc822 format available.

Notification sent to Chris Marusich <cmmarusich <at> gmail.com>:
bug acknowledged by developer. (Thu, 04 Feb 2021 08:28:02 GMT) Full text and rfc822 format available.

Message #10 received at 46253-close <at> debbugs.gnu.org (full text, mbox):

From: Chris Marusich <cmmarusich <at> gmail.com>
To: 46253-close <at> debbugs.gnu.org
Cc: Léo Le Bouter <lle-bout <at> zaclys.net>,
 Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: bug#46253: powerpc64le: gcc-final: "configure: error: cannot
 compute sizeof (long long)"
Date: Thu, 04 Feb 2021 00:26:50 -0800
[Message part 1 (text/plain, inline)]
Hi,

This is fixed in the following commit:

https://git.savannah.gnu.org/cgit/guix.git/commit/?h=wip-ppc64le&id=ffcc950261c829e76f2faf6c8ea03d3fc56a20e1

The problem was in the config.log, but I didn't see it at first:

"powerpc64le-guix-linux-gnu-ld: cannot find -lstdc++"

Léo mentioned that it was probably a linking problem, and when I checked
his commits in his own Git repository, I found this, which solved the
problem:

https://gitlab.com/lle-bout/guix/-/commit/070e06e8be6090a7682288c24b5686f1b578c001

However, that commit would have changed the way we link gcc-final with
libstdc++ on all architectures.  I have made a similar change that
accomplishes the same thing, but only for powerpc64le-linux (or other
Guix system types beginning with "powerpc64").  On existing Guix system
types, we will continue to link the same as before.

Using commit ffcc950261c829e76f2faf6c8ea03d3fc56a20e1, I was successful
in building gcc-final. I'm closing this bug report.

-- 
Chris
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#46253; Package guix. (Sun, 07 Feb 2021 00:54:01 GMT) Full text and rfc822 format available.

Message #13 received at 46253 <at> debbugs.gnu.org (full text, mbox):

From: Chris Marusich <cmmarusich <at> gmail.com>
To: 46253 <at> debbugs.gnu.org
Cc: Léo Le Bouter <lle-bout <at> zaclys.net>,
 Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: bug#46253: powerpc64le: gcc-final: "configure: error: cannot
 compute sizeof (long long)"
Date: Sat, 06 Feb 2021 16:53:38 -0800
[Message part 1 (text/plain, inline)]
Chris Marusich <cmmarusich <at> gmail.com> writes:

> configure:6100: error: cannot compute sizeof (long long)

It was mentioned on IRC that a better way to fix this would be to
configure libstdc++ to install to /lib instead of /lib64, since in Guix
we install libraries to /lib by convention, even on 64-bit systems.

See: https://logs.guix.gnu.org/guix/2021-02-06.log

I looked into this a bit more after that.  It turns out that we do
something like that already, in the original gcc package definition, for
existing architectures.  However, Léo pointed out that on the rs6000
architecture (i.e., powerpc), the gcc/config/rs6000 directory's build
logic hard-codes some /lib64 references.  I have added a phase that
replaces those hard-coded references. I should also mention that I did
try to use the --libdir configure flag to tell libstdc++ to install to
/lib64, but it didn't work; libstdc++ just ignored the flag and still
installed its libraries in /lib64.  Replacing the hard-coded references
fixed it, though.

In addition, I discovered that the libstdc++ package does not actually
re-use the package arguments from gcc.  Therefore, it was necessary to
add a similar phase in the make-libstdc++ procedure.

Although it is possible that, to resolve this specific bug (gcc-final:
"configure: error: cannot compute sizeof (long long)"), only the
make-libstdc++ change is necessary, it seems prudent to go ahead and
also make the change described above for gcc, to avoid future problems.
I have pushed both changes to wip-ppc64le in commit
db761a593992aea441055bda260461f4302a4667 on the wip-ppc64le branch.


-- 
Chris
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 Mar 2021 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.