Go to file
Christian Stewart 1a44f9242c package/go: cgo for the target needs the toolchain
Building go with cgo support needs to build some .c files to generate target
support code, and thus calls the cross C compiler, which is failing when the
toolchain is not built before host-go:

    >>> host-go 1.21.1 Building
    cd .../build/host-go-1.21.1/src && GO111MODULE=off GOCACHE=.../per-package/host-go/host/share/host-go-cache GOROOT_BOOTSTRAP=.../per-package/host-go/host/lib/go-1.19.11 GOROOT_FINAL=.../per-package/host-go/host/lib/go GOROOT=".../build/host-go-1.21.1" GOBIN=".../build/host-go-1.21.1/bin" GOOS=linux CC=/usr/bin/gcc CXX=/usr/bin/g++ CGO_ENABLED=1 CC_FOR_TARGET=".../per-package/host-go/host/bin/arm-linux-gcc" CXX_FOR_TARGET=".../per-package/host-go/host/bin/arm-linux-g++" GOOS="linux" GOARCH=arm  GOARM=6 GO_ASSUME_CROSSCOMPILING=1 ./make.bash
    Building Go cmd/dist using .../per-package/host-go/host/lib/go-1.19.11.  (go1.19.11 linux/amd64)
    go tool dist: cannot invoke C compiler [".../per-package/host-go/host/bin/arm-linux-gcc"]: fork/exec .../per-package/host-go/host/bin/arm-linux-gcc: no such file or directory

    Go needs a system C compiler for use with cgo.
    To set a C compiler, set CC=the-compiler.
    To disable cgo, set CGO_ENABLED=0.

This happens systematically with PPD, and happens without PPD when
host-go is explicitly built (by running: "make host-go").

Since only CGO support needs to compile C files, only add the toolchain
dependency in that case.

When the target is not supported by go, then there is obviously no need
to depend on the toolchain (even if we unconditionally enable cgo
support in only-for-the-host host-go).

Signed-off-by: Christian Stewart <christian@aperture.us>
[yann.morin@orange.com:
  - only add the toolchain dependency for target cgo
  - reword commit log
]
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Anisse Astier <anisse@astier.eu>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2023-09-30 08:41:33 +02:00
arch arch/powerpc: drop ABI selection 2023-08-20 23:22:27 +02:00
board board/raspberrypi: drop variant-specific genimage files 2023-09-29 09:12:46 +02:00
boot Merge branch 'next' 2023-09-07 16:50:14 +02:00
configs configs/visionfive2_defconfig: bump custom kernel version to 05533e9c31 2023-09-28 14:36:53 +02:00
docs docs/website: Update for 2023.08.1 2023-09-28 00:25:28 +02:00
fs fs/cpio: allow users to provide their own dracut modules 2023-02-06 22:46:35 +01:00
linux package/linux-headers: drop 6.4.x option 2023-09-27 21:06:30 +02:00
package package/go: cgo for the target needs the toolchain 2023-09-30 08:41:33 +02:00
support support/testing/tests/package/test_flutter.py: new runtime test 2023-09-30 00:12:07 +02:00
system package/systemd: bump linux-headers dependency to 4.14 2023-08-02 21:18:16 +02:00
toolchain {toolchain, linux-headers}: add support for 6.5 headers 2023-09-27 21:06:02 +02:00
utils utils/getdeveloperlib.py: handle file removal 2023-09-11 22:08:22 +02:00
.checkpackageignore checkpagage: drop ignore pattern fr removed pppd patches 2023-09-30 00:27:32 +02:00
.clang-format .clang-format: initial import from Linux 5.15.6 2022-01-01 15:01:13 +01:00
.defconfig
.flake8
.gitignore
.gitlab-ci.yml support/misc/gitlab-ci.yml.in: retry a job only if it failed due to a runner issue 2023-08-27 10:09:37 +02:00
.shellcheckrc utils/check-package: improve shellcheck reproducibility 2022-07-25 23:52:47 +02:00
CHANGES Update for 2023.08.1 2023-09-28 00:22:36 +02:00
Config.in package/sam-ba: drop 32bit host lib requirement 2023-07-30 23:41:44 +02:00
Config.in.legacy package/linux-headers: drop 6.4.x option 2023-09-27 21:06:30 +02:00
COPYING
DEVELOPERS support/testing/tests/package/test_flutter.py: new runtime test 2023-09-30 00:12:07 +02:00
Makefile Merge branch 'next' 2023-09-07 16:50:14 +02:00
Makefile.legacy
README docs: move the IRC channel away from Freenode 2021-05-29 22:16:23 +02:00

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches