Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew install gcc 6.1.0 fails becaus of jit-playback.c #1872

Closed
duansai opened this issue Jun 10, 2016 · 15 comments
Closed

brew install gcc 6.1.0 fails becaus of jit-playback.c #1872

duansai opened this issue Jun 10, 2016 · 15 comments

Comments

@duansai
Copy link

duansai commented Jun 10, 2016

Bug reports:

In jit-playback.c line 2474, the "ADD_ARG ("-Wl,-undefined,dynamic_lookup");" is added after the line:
"end add_arg".

Thus, I get the failure message of:

../../gcc/jit/jit-playback.c: In member function 'void gcc::jit::playback::context::invoke_external_driver(const char_, vec<char_>*)':
../../gcc/jit/jit-playback.c:2474:43: error: 'ADD_ARG' was not declared in this scope
ADD_ARG ("-Wl,-undefined,dynamic_lookup");

attached please find the log file for building gcc (gcc.txt).
gcc.txt

@UniqMartin
Copy link
Contributor

Sorry, but you have not followed the requested steps in our Troubleshooting Guide. Please follow (all of) these steps and post the information here so we can help you with your problem. Thanks!

@UniqMartin UniqMartin added the needs response Needs a response from the issue/PR author label Jun 10, 2016
@ttilley
Copy link
Contributor

ttilley commented Jun 10, 2016

gcc 6.1.10 fails to compile on 10.11

The homebrew package patches jit-playback.c to add exactly the line where the build fails: ADD_ARG ("-Wl,-undefined,dynamic_lookup");.
The patch is applied with a bit of fuzz: Hunk #1 succeeded at 2465 with fuzz 2 (offset 49 lines).
Just 45 lines above the added ADD_ARG is #undef ADD_ARG.

So the patch no longer applies cleanly to this version of gcc. A build log gist isn't going to be half as clear as the above.

@ghost ghost removed the needs response Needs a response from the issue/PR author label Jun 10, 2016
@UniqMartin
Copy link
Contributor

Thank you for the explanation! Is that because you're building gcc with --with-jit and this is not included in the default installation? That would explain why this went unnoticed when the GCC 6.1.0 update was tested on our CI (we're only testing the default configuration).

Can you research whether that patch can be dropped by now or whether it is still needed, but needs to be adapted? If it's any help, the patch was introduced in Homebrew/legacy-homebrew#42924. If you do, can you please create a pull request with the necessary changes to the gcc formula? I'll be happy to guide you through the rest of the process. Thanks!

@UniqMartin UniqMartin added the needs response Needs a response from the issue/PR author label Jun 10, 2016
@ttilley
Copy link
Contributor

ttilley commented Jun 11, 2016

I did indeed build gcc with --with-jit but this was more out of a habit to go nuts and enable ALL THE THINGS. ;)

This patch looks like it was actually accepted upstream in the gcc-5 branch, so it would be part of gcc 6.x. Looking at the jit-playback.c file there is an identical block about 55 or so lines above where the patch applies (and before the undef). Not being a gcc dev I can't say anything with complete confidence but it doesn't appear that at least the second part of this patch (the one that patches jit-playback.c) is necessary.

EDIT: I will have to poke at this more later. Unfortunately, I don't have the time today. @duansai - try going a brew edit gcc and removing the section of the formula that does the patch, as well as the patch itself from the bottom of the file. An update on your results would be helpful while I'm off doing other stuff.

@ghost ghost removed the needs response Needs a response from the issue/PR author label Jun 11, 2016
@duansai
Copy link
Author

duansai commented Jun 11, 2016

After removing the patch in jit-playback.c and keeping the modifications in ./gcc/jit/Make-lang.in, the installation of gcc 6.10 is successful. Thanks!

@RandomDSdevel
Copy link
Contributor

Any progress on fixing this in GCC's formula for all users? I may be having a similar issue myself.

@UniqMartin
Copy link
Contributor

Thanks everyone for the input! Is any of you actually using the JIT functionality and can provide test code or suggestions to check that the JIT functionality will work as intended after adjusting the patch? I realize that adjusting the patch as suggested will fix the build error, but it would be nice to have a way to verify things beyond making sure the GCC build completes without error.

I would be even more grateful if anyone could run those checks themselves against GCC 5.3, fix the formula for 6.1, check with that version again, and then submit a pull request with the fix. Thanks!

@zbeekman Do you happen to have experience with GCC's JIT functionality and can advise on the issue that has been raised here?

@zbeekman
Copy link
Contributor

@UniqMartin sorry, no experience with GCC's JIT... I'll do some very quick research now, but I make no promises...

@zbeekman
Copy link
Contributor

Perhaps @davidmalcolm can comment, since he's the GCC JIT maintainer... or we could try to email the GCC JIT list: [email protected]

@UniqMartin
Copy link
Contributor

@zbeekman Thanks! This was really just a blind guess you might be familiar with this. Let's see if any of the mentioned or already involved people have any comments or can research this further. If not, I'll try to do my own research and/or contact the mailing list. (Might take some time, as I'm not affected myself.)

@davidmalcolm
Copy link
Contributor

Yes, I'm the upstream gccjit maintainer.

I'm guessing the issue is to do with the patch you're applying downstream here:
https://github.com/Homebrew/homebrew-core/blob/master/Formula/gcc.rb#L254

I believe I upstreamed that patch in this commit:
gcc-mirror/gcc@2d511d1
and that it's in gcc 6.1 (and trunk), and in this backport to the gcc-5-branch:
gcc-mirror/gcc@2f88614

So the patch in your gcc.rb file should no longer be necessary.

Hope this is helpful

FWIW, I don't have an OS X box to hand, so I'm interested in hearing reports from people trying libgccjit on OS X.

@davidmalcolm
Copy link
Contributor

davidmalcolm commented Jun 13, 2016

Oops; I meant to say that the changes to jit-playback.c are upstream, and that that part of the patch should be dropped.

The changes to Make-lang.in here:
https://github.com/Homebrew/homebrew-core/blob/master/Formula/gcc.rb#L242
are still necessary, please keep that part.

@UniqMartin
Copy link
Contributor

@davidmalcolm Thanks a lot for your input and for the confirmation on what can be dropped and what needs to be retained! ❤️ I'll fix our gcc formula in a minute.

@UniqMartin
Copy link
Contributor

Pushed a fix to the formula in 891f9fd. Everyone affected: Please brew update and try again.

@zbeekman
Copy link
Contributor

zbeekman commented Apr 2, 2018

FYI this appears to be fixed on GCC trunk (--HEAD) and it looks like it may be backported to other branches.

Expect a PR to skip applying it to --HEAD builds

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants