Opened 3 years ago
Last modified 3 years ago
#63090 new defect
Cannot build gcc7 on Big Sur
Reported by: | weitzner (Brian Weitzner) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | ||
Port: | gcc7 |
Description
Failure when attempting to compile gcc7 on Big Sur. I have attached the relevant build log to this ticket. The error that is encountered is
:info:build ld: library not found for -lgcc_s.10.4 :info:build collect2: error: ld returned 1 exit status
Upon inspecting the MacOSX SDK, this library is indeed absent, but I would suspect there is an alternate library to provide similar functionality and that someone who is familiar with this codebase would know how and how to adjust (hopefully) with minimal effort. Finding a solution to this issue is important because I have a tool that needs to be build with gcc7 (otherwise it hangs or segfaults) and I cannot currently build it on a Mac.
Attachments (6)
Change History (8)
comment:1 Changed 3 years ago by kencu (Ken)
comment:2 Changed 3 years ago by weitzner (Brian Weitzner)
Thanks, Ken! I hopped over to iains's repo and will see what we can do over there.
Note: See
TracTickets for help on using
tickets.
The gcc7 port on MacPorts uses the official gcc sources, with minimal additional patches:
https://github.com/macports/macports-ports/blob/fe54f1efd433a461af0141b945e794e589398271/lang/gcc7/Portfile#L25
The Darwin maintainer of gcc upstream has his own repository of gcc fixes -- these are additions to the main upstream sources that he either has not yet added to the gcc official sources, or has not been able to have added to the gcc official sources as the branch is closed to updates.
He has some fixes in his gcc7 repo that look like they most likely would fix the build on BigSur. I have not tried it.
https://github.com/iains/gcc-7-branch/commits/gcc-7-darwin
So what you would do is to use his sources instead of the official sources in the gcc portfile, get rid (most likely) of our patches, or at least look them over, and then try building gcc7/libgcc7 using his sources and see if they build.
Or you could use his sources to generate a patchset that applies on top of the official gcc7 sources if you need to sell this idea to your company, etc.
If you are interested, then run the test suite and see if that passes your needs for accuracy. If it does, then you are good to go forever -- just peg that in your own repo and you have gcc7 on BigSur no matter what MacPorts does.
Or just have your own separate build of gcc7 that you use, and have it have nothing to do with MacPorts, if that suits you better.
If nothing I have written here makes any sense at all to you, then I'm afraid you're probably Out Of Luck, as it is not too likely anyone is going to do that in MacPorts, although you never know.