Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 922183 - sys-devel/binutils-apple-8.2.1-r103: #include <algorithm> fails on macOS Sonoma 14.2.1
Summary: sys-devel/binutils-apple-8.2.1-r103: #include <algorithm> fails on macOS Sono...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 OS X
: Normal major
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-15 19:27 UTC by Dylan
Modified: 2024-01-16 12:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,34.48 KB, application/octet-stream)
2024-01-15 19:29 UTC, Dylan
Details
emerge --info '=sys-devel/binutils-apple-8.2.1-r103::gentoo_prefix' (info.log,5.15 KB, text/plain)
2024-01-15 19:39 UTC, Dylan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dylan 2024-01-15 19:27:16 UTC
Attempting to run ./boostrap-prefix.sh for first time and now that gcc is fixed, I'm getting this:

```
/Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/darwin-xtools-gentoo-8.2.1-r103/ld64/src/ld/parsers/libunwind/DwarfInstructions.hpp:36:10: fatal error: algorithm: No such file or directory
   36 | #include <algorithm>
```

When trying to build:
```
sys-devel/binutils-apple-8.2.1-r103
```


Reproducible: Always

Steps to Reproduce:
1. ./bootstrap-prefix.sh
Actual Results:  
Crashes because algorithm header file cannot be found

Expected Results:  
Builds and installs

CHOST:     x86_64-apple-darwin23
IDENT:     x86_64-apple-darwin23

I'm on macOS 14.2.1 on Intel.

I put this as Major as it's a complete blocker for me, but unsure on actual priority or if I'm only person effected.

This is the only package from stage3 that fails to build.

I've tried running with this to ensure I'm on latest as well:
```
LATEST_TREE_YES=1 ./bootstrap-prefix.sh 
```
Comment 1 Dylan 2024-01-15 19:29:47 UTC
Created attachment 882357 [details]
build.log
Comment 2 Dylan 2024-01-15 19:34:13 UTC
Also, the vector header cannot be found.

```
[  1%] Building CXX object ld64/src/other/CMakeFiles/dyldinfo.dir/dyldinfo.cpp.o
cd /Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/binutils-apple-8.2.1_build/ld64/src/other && /Users/dylan/Gentoo/usr/bin/x86_64-apple-darwin23-g++ -DLD64_VERSION_NUM=\"274.2\" -DLD_VERS=\"xtools-ld64-274.2\" -DPACKAGE_VERSION="\"Gentoo binutils-apple-8.2.1-r103\"" -DTAPI_SUPPORT -DXTOOLS_BUGURL=\"https://bugs.gentoo.org/\" -DXTOOLS_VERSION=\"2.2.4\" -I/Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/binutils-apple-8.2.1_build/dyld-include -I/Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/binutils-apple-8.2.1_build/ld64 -I/Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/darwin-xtools-gentoo-8.2.1-r103/ld64/src/abstraction -I/Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/darwin-xtools-gentoo-8.2.1-r103/ld64/src/other -I/Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/darwin-xtools-gentoo-8.2.1-r103/ld64/src/ld -isystem /include -isystem /Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/binutils-apple-8.2.1_build/host-includes -isystem /Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/binutils-apple-8.2.1_build/include -isystem /Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/darwin-xtools-gentoo-8.2.1-r103/macho-target-includes  -march=native -O2 -pipe -fno-common -std=c++11 -stdlib=libc++ -lxar  -mmacosx-version-min=14.0 -MD -MT ld64/src/other/CMakeFiles/dyldinfo.dir/dyldinfo.cpp.o -MF CMakeFiles/dyldinfo.dir/dyldinfo.cpp.o.d -o CMakeFiles/dyldinfo.dir/dyldinfo.cpp.o -c /Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/darwin-xtools-gentoo-8.2.1-r103/ld64/src/other/dyldinfo.cpp
/Users/dylan/Gentoo/var/tmp/portage/sys-devel/binutils-apple-8.2.1-r103/work/darwin-xtools-gentoo-8.2.1-r103/ld64/src/other/PruneTrie.cpp:24:10: fatal error: vector: No such file or directory
   24 | #include <vector>
```

Repeated 2x for vector, 1x for utility, and 2x for algorithm.
Comment 3 Dylan 2024-01-15 19:39:50 UTC
Created attachment 882358 [details]
emerge --info '=sys-devel/binutils-apple-8.2.1-r103::gentoo_prefix'
Comment 4 Fabian Groffen gentoo-dev 2024-01-16 07:54:20 UTC
Confirmed on Darwin 17 too.  GCC-13 is build wrongly or somehting, building with GCC-12 succeeds.
Comment 5 Fabian Groffen gentoo-dev 2024-01-16 11:22:54 UTC
Ok, difference is that g++ 13 accepts -stdlib=libc++ while g++ 12 barks.  Using -stdlib=libc++ makes GCC drop the includes to its own headers for it, thus the includes are not found.
Comment 6 Larry the Git Cow gentoo-dev 2024-01-16 12:05:56 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6094c57a7d5e771e3b2f51955c4ca801ca9de614

commit 6094c57a7d5e771e3b2f51955c4ca801ca9de614
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2024-01-16 12:04:34 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2024-01-16 12:05:53 +0000

    sys-devel/binutils-apple-8.2.1-r103: fix build with GCC-13
    
    do not attempt to force libc++ usage, it doesn't always work
    
    Closes: https://bugs.gentoo.org/922183
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 sys-devel/binutils-apple/binutils-apple-8.2.1-r103.ebuild | 10 ++++++++++
 1 file changed, 10 insertions(+)