1

例如,我可以为目标构建mips64el-linux-gnu

$ guix build --no-substitutes --target=mips64el-linux-gnu hello
...
successfully built /gnu/store/sdhhi1fhgbldl5qyfwvwlzhf2gq41n0j-hello-2.10.drv
/gnu/store/rbl4yrjyj3vxn27cap1y24z5wkr90p8y-hello-2.10

但不适用于目标mipsel-linux-gnu

$ guix build --no-substitutes --target=mipsel-linux-gnu hello
Backtrace:
In guix/store.scm:
   1341:2 19 (map/accumulate-builds #<store-connection 256.99 7f2ad…&gt; …)
In srfi/srfi-1.scm:
   586:17 18 (map1 (#<package hello@2.10 gnu/packages/base.scm:74 7…&gt;))
In guix/store.scm:
   1300:8 17 (call-with-build-handler #<procedure build-accumulator…&gt; …)
In guix/scripts/build.scm:
   576:18 16 (_ _)
In guix/packages.scm:
  1169:16 15 (package-cross-derivation _ #<package hello@2.10 gnu/p…&gt; …)
  1510:22 14 (thunk)
  1447:22 13 (bag->cross-derivation #<store-connection 256.99 7f2ad…&gt; …)
In srfi/srfi-1.scm:
   586:17 12 (map1 (("cross-gcc" #<package gcc-cross-mipsel-lin…&gt;) …))
In guix/packages.scm:
  1212:16 11 (expand-input #<store-connection 256.99 7f2ad8295910> #f …)
  1169:16 10 (package-derivation _ #<package gcc-cross-mipsel-linux…&gt; …)
  1486:22  9 (thunk)
  1169:16  8 (package->bag _ _ _ #:graft? _)
  1279:43  7 (thunk)
In gnu/packages/cross-base.scm:
    265:9  6 (arguments #<package gcc-cross-mipsel-linux-gnu@7.5.0 g…&gt;)
   121:20  5 (cross-gcc-arguments "mipsel-linux-gnu" #<package gcc@…&gt; …)
In gnu/packages/gcc.scm:
   235:52  4 (arguments #<package gcc@4.8.5 gnu/packages/gcc.scm:364…&gt;)
In gnu/packages/bootstrap.scm:
   306:14  3 (glibc-dynamic-linker _)
In ice-9/boot-9.scm:
  1669:16  2 (raise-exception _ #:continuable? _)
  1669:16  1 (raise-exception _ #:continuable? _)
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
dynamic linker name not known for this system "mipsel-linux"

如何为这个目标构建?或者至少找出可用目标的完整列表?

4

1 回答 1

1

找出可用目标的完整列表

所有活动目标都列在 中的glibc-dynamic-linker函数中gnu/packages/bootstrap.scm

如何为这个目标构建?

你可以:

  1. 用你未来的包创建一个空目录;

  2. 将路径保存到环境变量中$GUIX_PACKAGE_PATH

  3. 将提到的bootstrap.scm文件放在这里:$GUIX_PACKAGE_PATH/gnu/packages/bootstrap.scm;

  4. 对其进行必要的更改:

    diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
    index 5a8028a465..102e7378ae 100644
    --- a/gnu/packages/bootstrap.scm
    +++ b/gnu/packages/bootstrap.scm
    @@ -317,6 +317,7 @@ or false to signal an error."
             ((string=? system "alpha-linux") "/lib/ld-linux.so.2")
             ((string=? system "s390x-linux") "/lib/ld64.so.1")
             ((string=? system "riscv64-linux") "/lib/ld-linux-riscv64-lp64d.so.1")
    +        ((string=? system "mipsel-linux") "/lib/ld.so.1")
    
             ;; XXX: This one is used bare-bones, without a libc, so add a case
             ;; here just so we can keep going.
    
  5. 并构建一个包(同时会构建一整套compiler/binutils/etc.-gcc-toolchain-):

    $ guix build --target=mipsel-linux-gnu hello
    ...
    /gnu/store/2vcvqn3c4ngif1l6s2dxambcpdmyywgc-hello-2.10
    
于 2021-12-21T11:26:39.907 回答