Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to modify CGO_ENABLED #67

Merged
merged 1 commit into from
Apr 13, 2021
Merged

Allow to modify CGO_ENABLED #67

merged 1 commit into from
Apr 13, 2021

Conversation

manuelbuil
Copy link
Contributor

Signed-off-by: Manuel Buil mbuil@suse.com

Signed-off-by: Manuel Buil <mbuil@suse.com>
@moshe010
Copy link
Collaborator

why do you want to do that? as far as I remember CGO_ENABLED=1 is required to plugin shared object.

@manuelbuil
Copy link
Contributor Author

why do you want to do that? as far as I remember CGO_ENABLED=1 is required to plugin shared object.

Because if that is enabled, the resulting binary is not static anymore and depends on the following libraries:

	linux-vdso.so.1 (0x00007fff9e2b0000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa5f5abd000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fa5f5702000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fa5f5cdc000)

As a result, the binary can't be run on slim images such as alpine or UBI.

As far as I understand, the C libraries are used for the net package but if CGO_ENABLED=0, then Go client is used for that

@manuelbuil
Copy link
Contributor Author

Another example: _build-webhook does not require CGO and without this PR, it is forced to use that and results in a dynamically linked binary

@zshi-redhat zshi-redhat merged commit bbc0397 into k8snetworkplumbingwg:master Apr 13, 2021
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.

3 participants