NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

install/50614: Architecture mismatch on Darwin



>Number:         50614
>Category:       install
>Synopsis:       Architecture mismatch on Darwin
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 03 00:10:00 +0000 2016
>Originator:     Markus Mayer
>Release:        HEAD on January 2, 2016
>Organization:
>Environment:
Darwin edmonds.home.lan 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64 i386 Macmini6,2 Darwin

>Description:
Bootstrapping a new pkgsrc installation, the bootstrap command would fail during the very first pkg_add. pkg_add would complain that the package was built for a different architecture than it is being installed on.

(This turned out to be a confusion between i386 [architecture] and x86_64 [binary format]).
>How-To-Repeat:
Simply run ./bootstrap --prefix=/opt/pkg --varbase=/var (just "./bootstrap" would likely do, too)
>Fix:
I think this is the right thing to do. Since "uname -p" always returns i386 on Darwin (but "uname -m" returns the actual machine architecture), one cannot rely on the output of "uname -p" if it is to be compared to the ouput of "uname -m" later.

Once I made this simple change to the bootstrap script, I was able to bootstrap my new pkgsrc installation.

$ git diff .
diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap
index 48f1abd..db0136e 100755
--- a/bootstrap/bootstrap
+++ b/bootstrap/bootstrap
@@ -555,7 +555,7 @@ Darwin)
        need_sed=no
        set_opsys=no
        get_abi "Darwin"
-       machine_arch=`uname -p`
+       machine_arch=`uname -m`
        CC=${CC:-"cc -isystem /usr/include"}; export CC
        check_compiler=yes
        osrev=`uname -r`



Home | Main Index | Thread Index | Old Index