Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 489902

Summary: bootstrap-prefix.sh: stage2 reports "UNKNOWN ARCH" on "OS X Mavericks"
Product: Gentoo/Alt Reporter: Linlin Yan <yanlinlin82>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: OS X   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to bootstrap-prefix.sh for OS X Mavericks

Description Linlin Yan 2013-10-30 19:45:21 UTC
So far bootstrap-prefix.sh can only handle x86_64-apple-darwin1[012], but not x86_64-apple-darwin13 (OS X Mavericks).

Reproducible: Always

Steps to Reproduce:
After I upgraded my MacBook Pro's OS to Mavericks (10.13), my Gentoo Prefix broken. Therefore, I tried to build Gentoo Prefix again from the beginning. This time, I followed the "Manual Bootstrap Process" steps.
Actual Results:  
During stage2, it reported:
* setting up some guessed defaults
* UNKNOWN ARCH: You need to set up a make.profile symlink to a
* profile in /Users/yanll/Gentoo/usr/portage for your CHOST x86_64-apple-darwin13
* prefix-portage successfully bootstrapped
* stage2 successfully finished

After that, stage3 can not run correctly:
yanll@localhost ~/Gentoo $ ./bootstrap-prefix.sh $EPREFIX stage3
* Bootstrapping Gentoo prefixed portage installation using
* host:   x86_64-apple-darwin13
* prefix: /Users/yanll/Gentoo
* ready to bootstrap stage3
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
!!! unknown GCC compiler
Comment 1 Linlin Yan 2013-10-30 20:10:01 UTC
Created attachment 362308 [details, diff]
patch to bootstrap-prefix.sh for OS X Mavericks
Comment 2 Linlin Yan 2013-10-30 20:12:42 UTC
In addition to the patch (to modify the bootstrap-prefix.sh), I also copied the profile directory as:
yanll@localhost ~/Gentoo $ cp -r usr/portage/profiles/prefix/darwin/macos/10.8/ usr/portage/profiles/prefix/darwin/macos/10.9/

Then the bootstrap script worked:
yanll@localhost ~/Gentoo $ ./bootstrap-prefix.sh $EPREFIX setup
yanll@localhost ~/Gentoo $ ./bootstrap-prefix.sh $EPREFIX stage3
Comment 3 Fabian Groffen gentoo-dev 2013-10-31 18:05:33 UTC
Thanks, I committed the profile, and your fix.  Tomorrow I can bump the bootstrap image.
Comment 4 Linlin Yan 2013-11-06 12:43:33 UTC
I have tried again from the beginning today.

The script bootstrap.sh is updated, however, it still failed at stage2 with the messages:

  ...
* setting up some guessed defaults
* Your profile is set to /Users/yanll/Gentoo/usr/portage/profiles/prefix/darwin/macos/10.9/x64.
./bootstrap-prefix.sh: line 326: /Users/yanll/Gentoo/usr/portage/profiles/prefix/darwin/macos/10.9/x64/make.defaults: No such file or directory
./bootstrap-prefix.sh: line 327: /Users/yanll/Gentoo/usr/portage/profiles/prefix/darwin/macos/10.9/x64/make.defaults: No such file or directory
./bootstrap-prefix.sh: line 332: /Users/yanll/Gentoo/usr/portage/profiles/prefix/darwin/macos/10.9/x64/make.defaults: No such file or directory
./bootstrap-prefix.sh: line 335: /Users/yanll/Gentoo/usr/portage/profiles/prefix/darwin/macos/10.9/x64/make.defaults: No such file or directory
./bootstrap-prefix.sh: line 338: /Users/yanll/Gentoo/usr/portage/profiles/prefix/darwin/macos/10.9/x64/make.defaults: No such file or directory
./bootstrap-prefix.sh: line 341: /Users/yanll/Gentoo/usr/portage/profiles/prefix/darwin/macos/10.9/x64/make.defaults: No such file or directory
* Your make.globals is prepared for your current bootstrap
* prefix-portage successfully bootstrapped
* stage2 successfully finished

What could I do to make this Gentoo Prefix available?
Comment 5 Fabian Groffen gentoo-dev 2013-11-06 15:59:55 UTC
could you please perform a bootstrap with LATEST_TREE_YES=1 exported in your environment?
Comment 6 Linlin Yan 2013-11-07 11:16:47 UTC
Thanks Fabian. The error disappeared with LATEST_TREE_YES=1 exported.

Now stage2 is all right, however, stage3 meets new problem (when emerge sys-devel/binutils-apple-4.3) like:

>>> Compiling source in /Users/yanll/Gentoo/var/tmp/portage/sys-devel/binutils-apple-4.3/work ...
 * building ld64-128.2
make LTO=0 CFLAGS=-march=nocona 'CXXFLAGS= -I../../dyld-195.6/include' 'LDFLAGS=-Wl,-search_paths_first -L/Users/yanll/Gentoo/usr/lib -L/Users/yanll/Gentoo/lib -L/Users/yanll/Gentoo/tmp/usr/lib '
g++ -m64 -I../../dyld-195.6/include -I/Users/yanll/Gentoo/usr/include -I/Users/yanll/Gentoo/tmp/usr/include -ULTO_SUPPORT -DNDEBUG -I/Users/yanll/Gentoo/var/tmp/portage/sys-devel/binutils-apple-4.3/work/libunwind/include "-DCPU_SUBTYPE_X86_ALL=((cpu_subtype_t)3)" -Iinclude -Iabstraction -Ild -Ild/parsers -Iother -I. "-ULTO"  -c -o other/rebase.o other/rebase.cpp
other/rebase.cpp:885:7: error: use of undeclared identifier 'realpath'
        if ( realpath(info.path, realFilePath) == NULL ) {
             ^
other/rebase.cpp:1005:19: error: use of undeclared identifier 'strtoull'
                                        lowAddress = strtoull(argv[++i], &endptr, 16);
                                                     ^
other/rebase.cpp:1008:20: error: use of undeclared identifier 'strtoull'
                                        highAddress = strtoull(argv[++i], &endptr, 16);
                                                      ^
3 errors generated.
make: *** [other/rebase.o] Error 1
emake failed
 * ERROR: sys-devel/binutils-apple-4.3 failed (compile phase):
 *   emake failed for ld64
 *
 * Call stack:
 *     ebuild.sh, line   93:  Called src_compile
 *   environment, line 2599:  Called compile_ld64
 *   environment, line  505:  Called die
 * The specific snippet of code:
 *       emake LTO=${LTO} CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS} -I../../${DYLD}/include" LDFLAGS="${LDFLAGS} ${LIBS}" || die "emake failed for ld64";
 *
 * If you need support, post the output of `emerge --info '=sys-devel/binutils-apple-4.3'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/binutils-apple-4.3'`.
 * The complete build log is located at '/Users/yanll/Gentoo/var/tmp/portage/sys-devel/binutils-apple-4.3/temp/build.log'.
 * The ebuild environment file is located at '/Users/yanll/Gentoo/var/tmp/portage/sys-devel/binutils-apple-4.3/temp/environment'.
 * Working directory: '/Users/yanll/Gentoo/var/tmp/portage/sys-devel/binutils-apple-4.3/work/ld64-128.2/src'
 * S: '/Users/yanll/Gentoo/var/tmp/portage/sys-devel/binutils-apple-4.3/work'

>>> Failed to emerge sys-devel/binutils-apple-4.3, Log file:

>>>  '/Users/yanll/Gentoo/var/tmp/portage/sys-devel/binutils-apple-4.3/temp/build.log'


BTW, Should I open a new bug for this?
Comment 7 Fabian Groffen gentoo-dev 2013-11-10 10:15:47 UTC
ok, I updated the bootstrap script.  Could you try with the updated script.  I don't think it changes anything, but just to be sure.  Please open a new bug for the bootstrap problem.  Thanks!
Comment 8 Linlin Yan 2013-11-10 13:19:25 UTC
I have tried the latest bootstrap-prefix.sh, followed as "Manual Bootstrap Process". It failed at stage2 with this message:

anll@localhost ~/Gentoo $ ./bootstrap-prefix.sh $EPREFIX stage2
* Bootstrapping Gentoo prefixed portage installation using
* host:   x86_64-apple-darwin13
* prefix: /Users/yanll/Gentoo
* ready to bootstrap stage2
* Fetching prefix-overlay-20131109.tar.bz2
--2013-11-10 20:59:23--  http://distfiles.gentoo.org/distfiles/prefix-overlay-20131109.tar.bz2
Connecting to 202.38.126.18:7777... connected.
Proxy request sent, awaiting response... 404 Not Found
2013-11-10 20:59:24 ERROR 404: Not Found.

--2013-11-10 20:59:24--  http://prefix.gentooexperimental.org/distfiles/prefix-overlay-20131109.tar.bz2
Connecting to 202.38.126.18:7777... connected.
Proxy request sent, awaiting response... 404 Not Found
2013-11-10 20:59:31 ERROR 404: Not Found.

!!! downloading http://prefix.gentooexperimental.org/distfiles/prefix-overlay-20131109.tar.bz2 failed!


I checked again and found that this latest script changed the PV value:

yanll@yanll-mac ~/Downloads $ diff bootstrap-prefix.sh{.old,}
377c377
< 	local PV="20130724"
---
> 	local PV="20131109"
442c442
< 	STABLE_PV="2.2.01.22124"
---
> 	STABLE_PV="2.2.7"


However, there is only prefix-overlay-20130724.tar.bz2 but not prefix-overlay-20131109.tar.bz2 on http://prefix.gentooexperimental.org/distfiles/
Comment 9 Fabian Groffen gentoo-dev 2013-11-10 14:00:43 UTC
should be there now, sorry about that
Comment 10 Linlin Yan 2013-11-10 15:43:03 UTC
Yes, I confirmed that by running stage1 and stage2 again. Now it works without "export LATEST_TREE_YES=1".
Comment 11 Fabian Groffen gentoo-dev 2013-11-10 15:54:38 UTC
ok, thanks