Quantcast

Fwd: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

René J.V. Bertin
Hello,

Please excuse the interruption - has anyone else been seeing this error when trying to build GCC (or possible, libgcc)?

And what about gcc 7, anyone been looking at that? 7.1 is out so there's no reason port should still be marked experimental...

Thanks,
René

-------------------------------
Forwarded message:
Subject: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"


#54149: gcc6 fails to compile because "configure: error: cannot compute sizeof
(long long)"
--------------------+------------------
 Reporter:  RJVB    |      Owner:
     Type:  defect  |     Status:  new
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  gcc6
--------------------+------------------
 Back in february I successfully built port:gcc6 with a tiny patch that
 makes G++ use libc++ and thus become a proper citizen on OS X 10.9 and
 later.

 Today I wanted to build a slightly improved version and find my builds
 fail no matter what I try because the bootstrapped gcc compiler (xgcc)
 chokes on the configure test to determine the sizeof(long long).

 Googling the error suggests that this has to do with the presence (or not)
 of the GNU binutils - which I don't have and didn't have either back in
 February.

 The only seemingly relevant port I updated since then is ld64_latest, but
 re-activating the version I had back then makes no difference. My patch
 cannot be the culprit either because it affects only the C++ compiler,
 which isn't used during the GCC build.

 Any ideas?

--
Ticket URL: <https://trac.macports.org/ticket/54149>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

Ryan Schmidt-24
I have not seen that problem building gcc6 before.

I have been updating gcc7 snapshots weekly and stopped recently when I realized they were preparing for the first release. I did not know they had now done so. I will update the ports once a snapshot of gcc8 is available (probably already is), since gcc6, gcc7 and gcc8 will need to be updated at the same time to move the libgcc subports around.

> On May 11, 2017, at 02:18, René J.V. Bertin <[hidden email]> wrote:
>
> Hello,
>
> Please excuse the interruption - has anyone else been seeing this error when trying to build GCC (or possible, libgcc)?
>
> And what about gcc 7, anyone been looking at that? 7.1 is out so there's no reason port should still be marked experimental...
>
> Thanks,
> René
>
> -------------------------------
> Forwarded message:
> Subject: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"
>
>
> #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof
> (long long)"
> --------------------+------------------
> Reporter:  RJVB    |      Owner:
>     Type:  defect  |     Status:  new
> Priority:  Normal  |  Milestone:
> Component:  ports   |    Version:
> Keywords:          |       Port:  gcc6
> --------------------+------------------
> Back in february I successfully built port:gcc6 with a tiny patch that
> makes G++ use libc++ and thus become a proper citizen on OS X 10.9 and
> later.
>
> Today I wanted to build a slightly improved version and find my builds
> fail no matter what I try because the bootstrapped gcc compiler (xgcc)
> chokes on the configure test to determine the sizeof(long long).
>
> Googling the error suggests that this has to do with the presence (or not)
> of the GNU binutils - which I don't have and didn't have either back in
> February.
>
> The only seemingly relevant port I updated since then is ld64_latest, but
> re-activating the version I had back then makes no difference. My patch
> cannot be the culprit either because it affects only the C++ compiler,
> which isn't used during the GCC build.
>
> Any ideas?
>
> --
> Ticket URL: <https://trac.macports.org/ticket/54149>
> MacPorts <https://www.macports.org/>
> Ports system for macOS

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

René J.V. Bertin
On Thursday May 11 2017 03:23:31 Ryan Schmidt wrote:

Hi,

>I have not seen that problem building gcc6 before.

Any idea what it could be? Even something silly as having the version already installed? I don't see how that could influence the parsing behaviour of the 1st bootstrapping compiler but then I don't see either how binutils could influence that behaviour as suggested in one of the tickets about the failure I found online (on CentOS).

I'm currently trying to build without my patch but I cannot image I would have been able to build the code once with it.

>I have been updating gcc7 snapshots weekly and stopped recently when I realized they were preparing for the first release. I did not know they had now done so. I will update the ports once a snapshot of gcc8 is available (probably already is), since gcc6, gcc7 and gcc8 will need to be updated at the same time to move the libgcc subports around.

Great, thanks. 7.1 has been released on May 2nd so it's still really fresh. Updating should just be a question of pointing the portfile to the release tarball, right? Given the claimed progress I could just as well stop trying to insist building gcc6 and do my own local upgrade.

About that patch of mine: would you be interested in including it? It's very simple: it modifies the code so that `lc++ -lc++abi -lsupc++` are linked in instead of -lstdc++ . There's 1 less trivial aspect to it: g++ must be pointed to internal C++ headers matching the runtime; the most straightforward and reliable way I found to get that right is to prepend ${prefix}libexec/llvm-${llvmversion}/include/c++/v1 to the system header search path (when the C++ standard includes are to be searched). That corresponds to what online instructions for command-line use show.

I've been able to use the resulting compiler to build complex KF5 applications with dependencies all built by various clang versions so this really appears to solve the C++ runtime issue. The only thing that doesn't work properly is SIMD-related: apparently you cannot build AVX code with GCC on Mac.

R.

>
>> On May 11, 2017, at 02:18, René J.V. Bertin <[hidden email]> wrote:
>>
>> Hello,
>>
>> Please excuse the interruption - has anyone else been seeing this error when trying to build GCC (or possible, libgcc)?
>>
>> And what about gcc 7, anyone been looking at that? 7.1 is out so there's no reason port should still be marked experimental...
>>
>> Thanks,
>> René
>>
>> -------------------------------
>> Forwarded message:
>> Subject: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"
>>
>>
>> #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof
>> (long long)"
>> --------------------+------------------
>> Reporter:  RJVB    |      Owner:
>>     Type:  defect  |     Status:  new
>> Priority:  Normal  |  Milestone:
>> Component:  ports   |    Version:
>> Keywords:          |       Port:  gcc6
>> --------------------+------------------
>> Back in february I successfully built port:gcc6 with a tiny patch that
>> makes G++ use libc++ and thus become a proper citizen on OS X 10.9 and
>> later.
>>
>> Today I wanted to build a slightly improved version and find my builds
>> fail no matter what I try because the bootstrapped gcc compiler (xgcc)
>> chokes on the configure test to determine the sizeof(long long).
>>
>> Googling the error suggests that this has to do with the presence (or not)
>> of the GNU binutils - which I don't have and didn't have either back in
>> February.
>>
>> The only seemingly relevant port I updated since then is ld64_latest, but
>> re-activating the version I had back then makes no difference. My patch
>> cannot be the culprit either because it affects only the C++ compiler,
>> which isn't used during the GCC build.
>>
>> Any ideas?
>>
>> --
>> Ticket URL: <https://trac.macports.org/ticket/54149>
>> MacPorts <https://www.macports.org/>
>> Ports system for macOS
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

René J.V. Bertin
In reply to this post by Ryan Schmidt-24
OK, I'm completely flabbergasted now. The build goes fine WITHOUT my patch so apparently there is something to it after all that interferes with the build.

It's clearly not a patch that I managed to get to work by applying it *after* a first successful build completion because it looks like repeating the build and destroot phases isn't possible anyway (which seems odd in itself).

Back to the drawingboard ...

R.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

Ryan Schmidt-24
In reply to this post by René J.V. Bertin
>> I have been updating gcc7 snapshots weekly and stopped recently when I realized they were preparing for the first release. I did not know they had now done so. I will update the ports once a snapshot of gcc8 is available (probably already is), since gcc6, gcc7 and gcc8 will need to be updated at the same time to move the libgcc subports around.
>
> Great, thanks. 7.1 has been released on May 2nd so it's still really fresh. Updating should just be a question of pointing the portfile to the release tarball, right?

It's a matter of doing the equivalent of this, with updated versions:

https://github.com/macports/macports-ports/commit/c4ddd1af302d5be105cbd58d2cb5dce89e892858

I will work on it later.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

René J.V. Bertin
On Thursday May 11 2017 07:38:01 Ryan Schmidt wrote:

> https://github.com/macports/macports-ports/commit/c4ddd1af302d5be105cbd58d2cb5dce89e892858

I was assuming that for my local copy I could start by just bumping the version, but I see now that might not work because port:gcc7 depends on port:libgcc .

Which btw could be redundant as far as libstdc++ is concerned: my initial port:gcc6+libcxx build has gcc depending on libc++ too.

R.

>
> I will work on it later.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

René J.V. Bertin
In reply to this post by Ryan Schmidt-24
On Thursday May 11 2017 07:38:01 Ryan Schmidt wrote:

> I will work on it later.

I think you're on the ticket CC list but in case you missed it:
https://trac.macports.org/ticket/53605#comment:8

R.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

René J.V. Bertin
In reply to this post by Ryan Schmidt-24
On Thursday May 11 2017 07:38:01 Ryan Schmidt wrote:

> It's a matter of doing the equivalent of this, with updated versions:
>
> https://github.com/macports/macports-ports/commit/c4ddd1af302d5be105cbd58d2cb5dce89e892858
>
> I will work on it later.

I hope you don't mind a helping hand :) if everything checks out I should be submitting a patch for the upgrade tomorrow.

Annoyingly libgfortran has apparently had an API change, its sonumber is increased.

R.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

Ryan Schmidt-24

> On May 18, 2017, at 18:55, René J.V. Bertin <[hidden email]> wrote:
>
> On Thursday May 11 2017 07:38:01 Ryan Schmidt wrote:
>
>> It's a matter of doing the equivalent of this, with updated versions:
>>
>> https://github.com/macports/macports-ports/commit/c4ddd1af302d5be105cbd58d2cb5dce89e892858
>>
>> I will work on it later.
>
> I hope you don't mind a helping hand :) if everything checks out I should be submitting a patch for the upgrade tomorrow.
>
> Annoyingly libgfortran has apparently had an API change, its sonumber is increased.

Yes. Therefore, we need to add a libgcc6 subport, much like the existing libgcc45 subport.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

René J.V. Bertin
On Thursday May 18 2017 19:05:31 Ryan Schmidt wrote:

>Yes. Therefore, we need to add a libgcc6 subport, much like the existing libgcc45 subport.

That seems like a small change to port:gcc6, almost easier than removing the libgcc subport completely.
But why is this handled differently that any other port that installs a library with a new ABI or name, when dependent ports just have to put up, revbump and rebuild?
Is that under a (proven?) assumption that some applications cannot be rebuilt against the new ABI? I don't see evidence of a dragonegg port based on gcc6 so that cannot be the reason.



FWIW, I'm also working on a (PoC) implementation of my idea to provide users who build from source with an option to get both ports from a single build. I'll present that as a separate patch to the Portfile. I have the impression that gcc7 took considerably longer to build than gcc6 so such an option would be timely for those users.

R.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [MacPorts] #54149: gcc6 fails to compile because "configure: error: cannot compute sizeof (long long)"

René J.V. Bertin
In reply to this post by Ryan Schmidt-24
On Thursday May 18 2017 19:05:31 Ryan Schmidt wrote:

> > I hope you don't mind a helping hand :) if everything checks out I should be submitting a patch for the upgrade tomorrow.
> >
> > Annoyingly libgfortran has apparently had an API change, its sonumber is increased.
>
> Yes. Therefore, we need to add a libgcc6 subport, much like the existing libgcc45 subport.

Here's my helping hand ticket :)
https://trac.macports.org/ticket/54198

I've tested this with a personal trick to keep libgfortran.3 around; everything seems to work just fine. I'm having a little trouble building R to use gfortran-mp-7; I suppose something must be changed to the compilers PG too (other than just setting the default from gcc6 to gcc7).

R.
Loading...