Subject: bug#46253: closed (Re: bug#46253: powerpc64le: gcc-final: "configure: error: cannot compute sizeof (long long)")

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 04 Feb 2021 08:28:02 +0000

Your bug report

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

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
46253: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=46253
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#46253: powerpc64le: gcc-final: "configure: error: cannot compute sizeof (long long)"
From: Chris Marusich <[email-masked]>
To: [email-masked]
Cc: Léo Le Bouter <[email-masked]>, Efraim Flashner <[email-masked]>
Date: Thu, 04 Feb 2021 00:26:50 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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

Subject: powerpc64le: gcc-final: "configure: error: cannot compute sizeof (long long)"
From: Chris Marusich <[email-masked]>
To: [email-masked]
Date: Tue, 02 Feb 2021 01:07:24 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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