Skip to content

cc_platform.mk: only use when GOARCH is set explicitly#4349

Closed
kolyshkin wants to merge 1 commit intoopencontainers:mainfrom
kolyshkin:xx
Closed

cc_platform.mk: only use when GOARCH is set explicitly#4349
kolyshkin wants to merge 1 commit intoopencontainers:mainfrom
kolyshkin:xx

Conversation

@kolyshkin
Copy link
Contributor

Current cc_platform.mk code assumes that if the value of GOARCH is the same as go env GOARCH output, we have a native build. This assumption is not correct when xx 1 is used to build runc (as it sets GOARCH etc in ~/.config/go/env file).

Let's only include cc_platform when GOARCH is set from the environment of the command line.

Related: #4346, moby/moby#48160, moby/moby#47666.

Current cc_platform.mk code assumes that if the value of GOARCH is the
same as `go env GOARCH` output, we have a native build. This assumption
is not correct when xx [1] is used to build runc (as it sets GOARCH etc
in ~/.config/go/env file).

Let's only include cc_platform when GOARCH is set from the environment
of the command line.

[1]: https://github.com/tonistiigi/xx

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin
Copy link
Contributor Author

Actually there's no need to have this either.

@kolyshkin kolyshkin closed this Jul 16, 2024
@kolyshkin
Copy link
Contributor Author

kolyshkin commented Jul 16, 2024

Actually there's no need to have this either.

Or, just use xx to set CC and CFLAGS STRIP explicitly, this way cc_platform doesn't do any guessing. See moby/moby#48160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant