Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 562800 - sys-devel/llvm-3.4.2 bootstrapping fails on MacOSX 10.11 -- ld: library not found for -lc++
Summary: sys-devel/llvm-3.4.2 bootstrapping fails on MacOSX 10.11 -- ld: library not f...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 3 votes (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-11 09:09 UTC by Justin Lecher (RETIRED)
Modified: 2016-04-10 06:24 UTC (History)
3 users (show)

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


Attachments
build.log (build.log.xz,85.01 KB, application/x-xz)
2015-10-11 09:11 UTC, Justin Lecher (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Lecher (RETIRED) gentoo-dev 2015-10-11 09:09:32 UTC
64/SubDir.lib__sanitizer_common/sanitizer_posix_libcdep.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_printf.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_stackdepot.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_stacktrace.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_stacktrace_libcdep.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_stoptheworld_linux_libcdep.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_suppressions.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_symbolizer.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_symbolizer_libcdep.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_symbolizer_posix_libcdep.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_symbolizer_win.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_thread_registry.o   /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/SubDir.lib__sanitizer_common/sanitizer_win.o -lstdc++ -undefined dynamic_lookup
ld: library not found for -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [/Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/i386/libcompiler_rt.dylib] Error 1
make[5]: *** Waiting for unfinished jobs....
ld: library not found for -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [/Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/tools/clang/runtime/compiler-rt/clang_darwin/asan_osx_dynamic/x86_64/libcompiler_rt.dylib] Error 1
make[4]: *** [BuildRuntimeLibraries] Error 2
rm /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/Release/lib/clang/3.4.2/lib/darwin_embedded/.dir /Volumes/iExtra/justin/Gentoo/tmp/var/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-.amd64/Release/lib/clang/3.4.2/lib/darwin/.dir
make[3]: *** [compiler-rt/.makeall] Error 2
make[2]: *** [all] Error 1
make[1]: *** [clang/.makeall] Error 2
make: *** [all] Error 1
 * ERROR: sys-devel/llvm-3.4.2::gentoo_prefix failed (compile phase):
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2015-10-11 09:11:01 UTC
Created attachment 414314 [details]
build.log
Comment 2 Fabian Groffen gentoo-dev 2015-10-11 10:28:29 UTC
I'm bootstrapping with latest tree, and it seems I've passed llvm-3.4.2, instead I crash on ncurses-6.
Comment 3 Fabian Groffen gentoo-dev 2015-10-11 10:29:05 UTC
(because it assumes there is a bash)
Comment 4 Fabian Groffen gentoo-dev 2015-10-11 14:27:02 UTC
I got stuck at pkgconfig which requires -framework CoreFoundation somehow.
Comment 5 Fabian Groffen gentoo-dev 2016-02-12 12:10:17 UTC
I think we've seen enough times this no longer is a problem, other things are
Comment 6 Anselm Busse 2016-02-12 12:41:41 UTC
I still have the problem when I try to bootstrap the prefix on my two Macs. I've just tried it again with the latest tree, but nothing changed. So please either tell me how you fixed the issue or reopen the bug.
Comment 7 Fabian Groffen gentoo-dev 2016-02-12 12:43:18 UTC
and it is llvm-3.4.2, not 3.7.1 or 3.5.2?
Comment 8 Anselm Busse 2016-02-12 15:03:56 UTC
yes, its sys-devel/llvm-3.4.2
Comment 9 Justin Lecher (RETIRED) gentoo-dev 2016-02-12 19:51:30 UTC
Still happens here.
Comment 10 Tim Schafer 2016-02-12 23:55:57 UTC
PV="20160211"
bootstrap-prefix.sh $EPREFIX noninteractive

With just CLT installed:
xcode-select -p
/Library/Developer/CommandLineTools
fails in stage3 at llvm-3.7.1::gentoo_prefix

With Xcode.app installed:
xcode-select -p
/Applications/Xcode.app/Contents/Developer
fails in stage2 at llvm-3.4.2

Hat tip to xdej on #gentoo-prefix for pointing out different xcode-select -p could produce different results for bootstrap-prefix.sh
Comment 11 Tim Schafer 2016-02-13 01:29:09 UTC
xcode-select -p
/Applications/Xcode.app/Contents/Developer
LATEST_TREE_YES=1 bootstrap-prefix.sh $EPREFIX noninteractive
fails in stage2 at llvm-3.4.2::gentoo_prefix
Comment 12 Justin Lecher (RETIRED) gentoo-dev 2016-02-15 12:36:58 UTC
Still happens here. Even with removed homebrew.
Comment 13 Guilherme Amadio gentoo-dev 2016-02-15 15:41:08 UTC
Without LATEST_TREE_YES=1 I hit this bug too on OS X El Capitan (10.11.3).
I am trying with LATEST_TREE_YES=1 now.
Comment 14 Guilherme Amadio gentoo-dev 2016-02-15 16:15:19 UTC
For the record, I get:

$ xcode-select -p
/Applications/Xcode.app/Contents/Developer

$ xcode-select -v
xcode-select version 2343.

Bootstrap fails for me both with and without LATEST_TREE_YES=1 on llvm-3.4.2.
I'm on an almost fresh install of OS X (no fink, homebrew, or anything else).
Comment 15 Tim Schafer 2016-02-15 18:46:03 UTC
With Xcode.app installed:
sudo xcode-select -s /Library/Developer/CommandLineTools

LATEST_TREE_YES=1 bootstrap-prefix.sh $EPREFIX noninteractive
fails in stage3 at llvm-3.7.1::gentoo_prefix
Comment 16 Tim Schafer 2016-02-15 19:10:26 UTC
That last run using CLT path was initiated right after the stage2 failure posted using Xcode.app path. bootstrap-prefix.sh has already had some work since that was started. Retesting...
Comment 17 Tim Schafer 2016-02-15 22:40:36 UTC
$ sw_vers -productVersion
10.11.3
$ xcode-select -v
xcode-select version 2343.
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
LATEST_TREE_YES=1 bootstrap-prefix.sh $EPREFIX noninteractive
fails in stage2 at llvm-3.4.2::gentoo_prefix

$ sudo xcode-select -s /Library/Developer/CommandLineTools
LATEST_TREE_YES=1 bootstrap-prefix.sh $EPREFIX noninteractive
fails in stage3 at os-headers-0::gentoo_prefix
Comment 18 Justin Lecher (RETIRED) gentoo-dev 2016-02-16 10:00:49 UTC
The following setting allowed me to pass stage2 build

$ sw_vers -productVersion && xcode-select -v && xcode-select -p
10.11.3
xcode-select version 2343.
/Library/Developer/CommandLineTools

Using Xcode-7.2.1 fails.
Comment 19 Justin Lecher (RETIRED) gentoo-dev 2016-02-16 13:13:02 UTC
(In reply to Justin Lecher from comment #18)
> The following setting allowed me to pass stage2 build
> 
> $ sw_vers -productVersion && xcode-select -v && xcode-select -p
> 10.11.3
> xcode-select version 2343.
> /Library/Developer/CommandLineTools
> 
> Using Xcode-7.2.1 fails.

Using the Xcode-7.2.0 commandline tools stage2 build works but stage3 build fails for llvm-3.5.2 with "ld: library not found for -lSystem".
Comment 20 Justin Lecher (RETIRED) gentoo-dev 2016-02-17 09:36:53 UTC
(In reply to Justin Lecher from comment #19)
> (In reply to Justin Lecher from comment #18)
> > The following setting allowed me to pass stage2 build
> > 
> > $ sw_vers -productVersion && xcode-select -v && xcode-select -p
> > 10.11.3
> > xcode-select version 2343.
> > /Library/Developer/CommandLineTools
> > 
> > Using Xcode-7.2.1 fails.
> 
> Using the Xcode-7.2.0 commandline tools stage2 build works but stage3 build
> fails for llvm-3.5.2 with "ld: library not found for -lSystem".

I have to correct myself, using commandline tools version 7.2.0 let me bootstrap the whole thing.
Comment 21 Anselm Busse 2016-02-17 18:31:39 UTC
I gave it another try using commandline tools version 7.2.1 and I also got past llvm. However, I think I'm running into the same problem now Tim already mentioned. But I think the issue is not the virtual/os-headers-0 package because I get the following error:

>>> Installing (1 of 1) virtual/os-headers-0::gentoo_prefix
 * checking 0 files for package collisions
>>> Merging virtual/os-headers-0 to /
>>> virtual/os-headers-0 merged.
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.
date: invalid date '<?xml version="1.0" encoding="UTF-8"?>'
date: invalid date '<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">'
date: invalid date '<pkgmetadata>'
date: invalid date '  <maintainer type="person">'
date: invalid date '    <email>maintainer-needed@gentoo.org</email>'
date: invalid date '  </maintainer>'
date: invalid date '  <longdescription lang="en">'
date: invalid date '\t</longdescription>'
date: invalid date '  <upstream>'
date: invalid date '    <remote-id type="github">coreos/fleet</remote-id>'
date: invalid date '  </upstream>'
date: invalid date '</pkgmetadata>'
dyld: Library not loaded: /Users/abusse/Library/Gentoo/tmp/usr/lib/libreadline.6.dylib
  Referenced from: /Users/abusse/Library/Gentoo/bin/bash
  Reason: image not found
Failed to validate a sane '/dev'.
bash process substitution doesn't work; this may be an indication of a broken '/dev/fd'.
dyld: Library not loaded: /Users/abusse/Library/Gentoo/tmp/usr/lib/libreadline.6.dylib
  Referenced from: /Users/abusse/Library/Gentoo/bin/bash
  Reason: image not found
./bootstrap-prefix.sh: line 1218: 77583 Trace/BPT trap: 5       emerge-webrsync

I took a closer look and it turns out /Users/abusse/Library/Gentoo/tmp/ is empty. So it's not surprising that it cannot load the libreadline.
Comment 22 Justin Lecher (RETIRED) gentoo-dev 2016-02-17 18:35:16 UTC
(In reply to Anselm Busse from comment #21)
> I gave it another try using commandline tools version 7.2.1 and I also got

How did you get the commandline tools version 7.2.1?

> 
> >>> No outdated packages were found on your system.
> date: invalid date '<?xml version="1.0" encoding="UTF-8"?>'
> date: invalid date '<!DOCTYPE pkgmetadata SYSTEM
> "http://www.gentoo.org/dtd/metadata.dtd">'
> date: invalid date '<pkgmetadata>'
> date: invalid date '  <maintainer type="person">'
> date: invalid date '    <email>maintainer-needed@gentoo.org</email>'
> date: invalid date '  </maintainer>'

@prefix devs, this is completely wrong. There is no such person.

> /Users/abusse/Library/Gentoo/tmp/usr/lib/libreadline.6.dylib
>   Referenced from: /Users/abusse/Library/Gentoo/bin/bash
>   Reason: image not found
> Failed to validate a sane '/dev'.
> bash process substitution doesn't work; this may be an indication of a
> broken '/dev/fd'.
> dyld: Library not loaded:
> /Users/abusse/Library/Gentoo/tmp/usr/lib/libreadline.6.dylib
>   Referenced from: /Users/abusse/Library/Gentoo/bin/bash
>   Reason: image not found
> ./bootstrap-prefix.sh: line 1218: 77583 Trace/BPT trap: 5      
> emerge-webrsync
> 
> I took a closer look and it turns out /Users/abusse/Library/Gentoo/tmp/ is
> empty. So it's not surprising that it cannot load the libreadline.

I also saw this and just created a symlink from TMPDIR/usr/lib -> PREFIX/usr/lib and that worked.
Comment 23 Anselm Busse 2016-02-17 18:44:54 UTC
(In reply to Justin Lecher from comment #22)

> How did you get the commandline tools version 7.2.1?

I guess they came with Xcode 7.2.1 or did misinterpret the information in Xcode? It says "Command Line Tools: Xcode 7.2.1 (7C1002)"

> I also saw this and just created a symlink from TMPDIR/usr/lib ->
> PREFIX/usr/lib and that worked.

Tried it and got past the error. Emerging the rest now. However, I guess that shouldn't be a permanent solution ;)
Comment 24 Fabian Groffen gentoo-dev 2016-02-18 08:39:39 UTC
(In reply to Justin Lecher from comment #22)
> > >>> No outdated packages were found on your system.
> > date: invalid date '<?xml version="1.0" encoding="UTF-8"?>'
> > date: invalid date '<!DOCTYPE pkgmetadata SYSTEM
> > "http://www.gentoo.org/dtd/metadata.dtd">'
> > date: invalid date '<pkgmetadata>'
> > date: invalid date '  <maintainer type="person">'
> > date: invalid date '    <email>maintainer-needed@gentoo.org</email>'
> > date: invalid date '  </maintainer>'
> 
> @prefix devs, this is completely wrong. There is no such person.

I don't know what we can do about that, actually ... :(

> > I took a closer look and it turns out /Users/abusse/Library/Gentoo/tmp/ is
> > empty. So it's not surprising that it cannot load the libreadline.
> 
> I also saw this and just created a symlink from TMPDIR/usr/lib ->
> PREFIX/usr/lib and that worked.

What stage is this? This obviously is wrong, it means tmp got nuked before we replaced everything in this.
Comment 25 Anselm Busse 2016-02-18 08:48:51 UTC
(In reply to Fabian Groffen from comment #24)
 
> What stage is this? This obviously is wrong, it means tmp got nuked before
> we replaced everything in this.

It was during stage3 and happened again after llvm. I recreated a link as suggested by Justin and it finished stage3. It's emerging system right now and so far everything beyond stage3 seems to be fine.
Comment 26 Justin Lecher (RETIRED) gentoo-dev 2016-02-18 08:55:46 UTC
(In reply to Fabian Groffen from comment #24)
> (In reply to Justin Lecher from comment #22)
> > > >>> No outdated packages were found on your system.
> > > date: invalid date '<?xml version="1.0" encoding="UTF-8"?>'
> > > date: invalid date '<!DOCTYPE pkgmetadata SYSTEM
> > > "http://www.gentoo.org/dtd/metadata.dtd">'
> > > date: invalid date '<pkgmetadata>'
> > > date: invalid date '  <maintainer type="person">'
> > > date: invalid date '    <email>maintainer-needed@gentoo.org</email>'
> > > date: invalid date '  </maintainer>'
> > 
> > @prefix devs, this is completely wrong. There is no such person.
> 
> I don't know what we can do about that, actually ... :(

The problem is that some metadata.xml are broken in the prefix tree

~/Gentoo/usr/portage $ (126) find -name metadata.xml -exec grep maintainer-needed@ '{}' +
./app-admin/fleet/metadata.xml:    <email>maintainer-needed@gentoo.org</email>
./app-backup/rdiff-backup/metadata.xml:		<email>maintainer-needed@gentoo.org</email>
./app-editors/diakonos/metadata.xml:		<email>maintainer-needed@gentoo.org</email>


> 
> > > I took a closer look and it turns out /Users/abusse/Library/Gentoo/tmp/ is
> > > empty. So it's not surprising that it cannot load the libreadline.
> > 
> > I also saw this and just created a symlink from TMPDIR/usr/lib ->
> > PREFIX/usr/lib and that worked.
> 
> What stage is this? This obviously is wrong, it means tmp got nuked before
> we replaced everything in this.

This allows me to emerge bash and other packages so that they correctly get linked to the PREFIX libs. The link is only temporary.
Comment 27 Guillaume DIDIER 2016-03-05 18:09:45 UTC
I get the same failure ate stage2 with Xcode 7.2.1 installed (+CLT), i.e. :

ld: library not found for -lc++
ld: library not found for -lc++
clang: error: clang: error: linker command failed with exit code 1 (use -v to see invocation)
linker command failed with exit code 1 (use -v to see invocation)
Comment 28 Fabian Groffen gentoo-dev 2016-03-05 20:16:56 UTC
do you have commandline tools installed?
Comment 29 Guillaume DIDIER 2016-03-06 05:54:33 UTC
(In reply to Fabian Groffen from comment #28)
> do you have commandline tools installed?

$ which clang
/usr/bin/clang

$ xcode-select -v
xcode-select version 2343.

$ xcode-select -p
/Applications/Xcode.app/Contents/Developer

So yes the CLT are installed unless I am utterly mistaken.
Comment 30 Fabian Groffen gentoo-dev 2016-03-06 08:21:09 UTC
(In reply to Justin Lecher from comment #26)
> (In reply to Fabian Groffen from comment #24)
> > (In reply to Justin Lecher from comment #22)
> > > > >>> No outdated packages were found on your system.
> > > > date: invalid date '<?xml version="1.0" encoding="UTF-8"?>'
> > > > date: invalid date '<!DOCTYPE pkgmetadata SYSTEM
> > > > "http://www.gentoo.org/dtd/metadata.dtd">'
> > > > date: invalid date '<pkgmetadata>'
> > > > date: invalid date '  <maintainer type="person">'
> > > > date: invalid date '    <email>maintainer-needed@gentoo.org</email>'
> > > > date: invalid date '  </maintainer>'
> > > 
> > > @prefix devs, this is completely wrong. There is no such person.
> > 
> > I don't know what we can do about that, actually ... :(
> 
> The problem is that some metadata.xml are broken in the prefix tree
> 
> ~/Gentoo/usr/portage $ (126) find -name metadata.xml -exec grep
> maintainer-needed@ '{}' +
> ./app-admin/fleet/metadata.xml:   
> <email>maintainer-needed@gentoo.org</email>
> ./app-backup/rdiff-backup/metadata.xml:	
> <email>maintainer-needed@gentoo.org</email>
> ./app-editors/diakonos/metadata.xml:	
> <email>maintainer-needed@gentoo.org</email>

these don't come from the prefix tree, so I guess this came from an old bootstrap snapshot
Comment 31 Fabian Groffen gentoo-dev 2016-04-10 06:24:05 UTC
I've pushed a check for CommandLineTools, and the bootstraps I've performed on 10.11 all worked, so I think this bug has been fixed.