Opened 2 years ago
Last modified 2 years ago
#65789 assigned defect
libgcc-devel @12-20220828_0+stdlib_flag build failure: use of undeclared identifier 'PTR'
Reported by: | physicsbeany | Owned by: | michaelld (Michael Dickens) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.2 |
Keywords: | Cc: | cjones051073 (Chris Jones), mascguy (Christopher Nielsen) | |
Port: | libgcc-devel |
Description
I'm running "port upgrade outdated" on my 2021 Macbook (Apple M1 Pro) running MacOS Monterey (12.5.1). The upgrade is failing with libgcc-devel, and when I look in the log file, the first instance of "error" I see is the following:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_github.com_macports_macports-ports_lang_gcc-devel/libgcc-devel/work/gcc-12-branch-95e1e79418aabc0440b44362c818e0e7072847d8/libiberty/objalloc.c:95:18: error: use of undeclared identifier 'PTR'
Attachments (2)
Change History (25)
Changed 2 years ago by physicsbeany
Attachment: | libgcc-devel_BUILD.log added |
---|
comment:1 Changed 2 years ago by mascguy (Christopher Nielsen)
Cc: | cjones051073 mascguy added |
---|---|
Owner: | set to michaelld |
Priority: | High → Normal |
Status: | new → assigned |
comment:2 Changed 2 years ago by mascguy (Christopher Nielsen)
Summary: | libgcc-devel @12-20220828_0+stdlib_flag build failure: "use of undeclared identifier 'PTR'" → libgcc-devel @12-20220828_0+stdlib_flag build failure: use of undeclared identifier 'PTR' |
---|
It looks like you're still running MacPorts 2.7.1. Can you upgrade to 2.7.2, via sudo port selfupdate
, and try again?
Be sure to clean with sudo port clean --all libgcc-devel
first though, before reattempting installation.
comment:3 follow-up: 4 Changed 2 years ago by physicsbeany
Hi. Thanks for the advice. I did update to 2.7.2 as suggested, and the error persists.
I also ran "sudo port clean --all libgcc-devel" before attempting the upgrade -- the error persists.
[should I Modify the Ticket to 2.7.2?]
comment:4 Changed 2 years ago by mascguy (Christopher Nielsen)
Version: | 2.7.1 → 2.7.2 |
---|
Replying to physicsbeany:
Hi. Thanks for the advice. I did update to 2.7.2 as suggested, and the error persists.
I also ran "sudo port clean --all libgcc-devel" before attempting the upgrade -- the error persists.
Can you try the following, to force installation of the pre-built binary: sudo port -b install libgcc-devel
.
comment:5 follow-up: 7 Changed 2 years ago by physicsbeany
If I try the pre-built binary route, I get the "no usable archive sites configured" error:
$ sudo port -b install libgcc-devel Warning: configured user/group <my group name> does not exist, will build as root ---> Computing dependencies for libgcc-devel Error: Failed to archivefetch libgcc-devel: Binary-only mode requested with no usable archive sites configured Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_github.com_macports_macports-ports_lang_gcc-devel/libgcc-devel/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port libgcc-devel failed
comment:6 Changed 2 years ago by michaelld (Michael Dickens)
comment:7 Changed 2 years ago by mascguy (Christopher Nielsen)
Replying to physicsbeany:
If I try the pre-built binary route, I get the "no usable archive sites configured" error:
$ sudo port -b install libgcc-devel Warning: configured user/group <my group name> does not exist, will build as root ---> Computing dependencies for libgcc-devel Error: Failed to archivefetch libgcc-devel: Binary-only mode requested with no usable archive sites configured
Just curious, did you migrate your MacPorts installation from a previous macOS release?
If so, you need to follow the steps here:
But if you didn't migrate, then we have more digging to do. Let us know either way!
comment:8 Changed 2 years ago by cjones051073 (Chris Jones)
Any specific reason you are using (lib)gcc-devel, instead of the defal which would be libgcc which in turn brings in the gcc12 release ?
The devel ports are always going to be a bit more unstable than the production releases.
comment:9 Changed 2 years ago by physicsbeany
@cjoines051073, I had some reason for needing libgcc-devel, but I don't recall the decision-making process. I just looked to see what depended on it, and I got the following:
> port dependents libgcc-devel OpenBLAS depends on libgcc-devel gcc12 depends on libgcc-devel gsl depends on libgcc-devel libgcc11 depends on libgcc-devel openmpi-default depends on libgcc-devel
I just tried nuking those five ports -- plus their own dependencies -- and doing a clean reinstall of a top-level port I know I wanted, openmpi. This looked like it was going to avoid libgcc-devel, using libgcc12 instead, but that failed too (different error):
> port install openmpi ---> Computing dependencies for openmpi The following dependencies will be installed: gcc12 libgcc libgcc12 openmpi-default Continue? [Y/n]: Portfile changed since last build; discarding previous state. ---> Fetching distfiles for libgcc12 ---> Attempting to fetch gcc-12.2.0.tar.xz from https://distfiles.macports.org/gcc12 ---> Verifying checksums for libgcc12 ---> Extracting libgcc12 ---> Applying patches to libgcc12 ---> Configuring libgcc12 ---> Building libgcc12 Error: Failed to build libgcc12: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_github.com_macports_macports-ports_lang_gcc12/libgcc12/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port openmpi failed
I'm attaching that new log here.
Changed 2 years ago by physicsbeany
Attachment: | libgcc12_FAILURE.log added |
---|
log file from failure to install libgcc12 instead of libgcc-devel
comment:10 Changed 2 years ago by mascguy (Christopher Nielsen)
Unless I'm missing something - or you've explicitly disabled it by choice - your system should be installing our pre-built binaries.
Can you kindly respond to my questions in comment:7, before we go down any other rabbit holes?
comment:11 follow-up: 12 Changed 2 years ago by physicsbeany
Hi @mascguy. sorry for missing that question.
This is the only Macports install on this M1 machine, which came with the MacOS version it's running -- Monterey. The OS has gone through a couple of minor updates since then -- 12.4 -> 12.5 -> 12.5.1 -- but I assume those don't require a migration of the kind you're talking about.
As to your other question, I've generally been building from source rather than prebuilt binaries.
comment:12 follow-up: 14 Changed 2 years ago by mascguy (Christopher Nielsen)
Replying to physicsbeany:
Hi @mascguy. sorry for missing that question.
This is the only Macports install on this M1 machine, which came with the MacOS version it's running -- Monterey. The OS has gone through a couple of minor updates since then -- 12.4 -> 12.5 -> 12.5.1 -- but I assume those don't require a migration of the kind you're talking about.
Okay great, that eliminates one variable from the mix. And no, a migration is only necessary when moving to a different major version.
Thanks for confirming!
As to your other question, I've generally been building from source rather than prebuilt binaries.
I suppose there's nothing wrong with that, if you don't mind waiting. (While they are very speedy, even M1 Macs take some time to churn through complex ports like gcc
and libgcc
.) That being said, by building everything from source, you're also more likely to encounter issues. So caveat emptor!
In the interim, it looks like you don't have a full version of Xcode installed:
debug:sysinfo Xcode none
Can you install that - using the version matching your Xcode Command-Line Tools - and then try again? (You can identify your Xcode CLT version via xcodebuild -version
.)
comment:14 Changed 2 years ago by physicsbeany
Hi. Sorry for the radio silence. It was a while before I could try this out.
I did install the full Xcode (v. 14), and tried a clean install of this port. It still fails, with the same "PTR" error I was seeing when I was just using command line tools.
Replying to mascguy:
In the interim, it looks like you don't have a full version of Xcode installed:
debug:sysinfo Xcode noneCan you install that - using the version matching your Xcode Command-Line Tools - and then try again? (You can identify your Xcode CLT version via
xcodebuild -version
.)
Side comment: xcodebuild -version
doesn't tell you what version of the CLT you have installed -- it doesn't exist unless you have the full Xcode installed to begin with. Instead I used the clang version (also 14) as a proxy, referring to this table to relate to the CLT version: https://en.wikipedia.org/wiki/Xcode
comment:15 follow-up: 16 Changed 2 years ago by cjones051073 (Chris Jones)
latest versions of libgcc-devel and libgcc12 build just fine on AppleSilicon
https://ports.macports.org/port/libgcc-devel/details/
https://ports.macports.org/port/libgcc12/details/
So I am afraid but the reason for the failures you are seeing are specific to your setup, so you are going to have to investigate yourself.
comment:16 follow-up: 17 Changed 2 years ago by mascguy (Christopher Nielsen)
Replying to cjones051073:
So I am afraid but the reason for the failures you are seeing are specific to your setup, so you are going to have to investigate yourself.
Alternatively, just eliminate these headaches, and use our binaries: They are built by us from source - as are all dependencies - so they can be trusted.
comment:17 Changed 2 years ago by physicsbeany
Replying to mascguy:
Replying to cjones051073:
So I am afraid but the reason for the failures you are seeing are specific to your setup, so you are going to have to investigate yourself.
Alternatively, just eliminate these headaches, and use our binaries: They are built by us from source - as are all dependencies - so they can be trusted.
As I noted in a reply upthread (comment:5), I did try a binary install, but it failed immediately with a "no usable archive sites configured" error. This may be because my installation started as source-only, so an archive was never configured? I'm having trouble finding out how to fix this (I see an older ticket #59463 with a related title, but it appears to describe a different situation -- and I don't understand the workaround anyway).
comment:18 follow-up: 19 Changed 2 years ago by kencu (Ken)
Two fast and effective solutions for you.
- try
sudo port -v diagnose
and see what secrets it tells you. There may be a quick fix in there.
- start over. Sometimes it's just 1000x faster. <https://guide.macports.org/chunked/installing.macports.uninstalling.html>
comment:19 follow-up: 20 Changed 2 years ago by physicsbeany
Replying to kencu:
Two fast and effective solutions for you.
- try
sudo port -v diagnose
and see what secrets it tells you. There may be a quick fix in there.
- start over. Sometimes it's just 1000x faster. <https://guide.macports.org/chunked/installing.macports.uninstalling.html>
Aha! I just tried suggestion number 1:
Error: currently installed version of Xcode, 14.0, is not supported by MacPorts. For your currently installed system, only the following versions of Xcode are supported: 13.4.1 13.4 13.3.1 13.3 13.2.1 13.2 13.1
... but 2.7.2 is the most recent release of MacPorts, right? So does this mean anything? Should I downgrade my XCode to 13.x? @cjones051073, are you using XCode 14 too?
comment:20 Changed 2 years ago by cjones051073 (Chris Jones)
Replying to physicsbeany:
Replying to kencu:
Two fast and effective solutions for you.
- try
sudo port -v diagnose
and see what secrets it tells you. There may be a quick fix in there.
- start over. Sometimes it's just 1000x faster. <https://guide.macports.org/chunked/installing.macports.uninstalling.html>
Aha! I just tried suggestion number 1:
Error: currently installed version of Xcode, 14.0, is not supported by MacPorts. For your currently installed system, only the following versions of Xcode are supported: 13.4.1 13.4 13.3.1 13.3 13.2.1 13.2 13.1... but 2.7.2 is the most recent release of MacPorts, right? So does this mean anything? Should I downgrade my XCode to 13.x? @cjones051073, are you using XCode 14 too?
Yes I am. Ignore the above, it just means the supported list needs updating.
Using archives is the default, so for you not to be must means you made some change to your system that prevents it.
Did you edit /opt/local/etc/macports/macports.conf by chance ? Check what is in there in relation to archives.
comment:21 Changed 2 years ago by kencu (Ken)
even so, re-enabling whatever has hosed your binaries won't solve your PTR problem, it will just cover it over by not building anything.
Remove everything from /usr/local, remove any added stuff to your PATH, CFLAGS, CXXFLAGS, etc in your init scripts, and blow out macports and start fresh.
To quote the always-practical Ripley: "Nuke 'em from orbit -- it's the only way to be sure."
Really, how many more weeks do you have to spend on this?
comment:22 Changed 2 years ago by mvtiaine (Matti Tiainen)
Had the same issue with libgcc12 and it was fixed with sudo port deactivate binutils
. Though now hitting #65573.
logfile of failed upgrade