OpenCloudOS-Kernel/net/bpfilter
Masahiro Yamada 9326e0f85b bpfilter: Allow to build bpfilter_umh as a module without static library
Originally, bpfilter_umh was linked with -static only when
CONFIG_BPFILTER_UMH=y.

Commit 8a2cc0505c ("bpfilter: use 'userprogs' syntax to build
bpfilter_umh") silently, accidentally dropped the CONFIG_BPFILTER_UMH=y
test in the Makefile. Revive it in order to link it dynamically when
CONFIG_BPFILTER_UMH=m.

Since commit b1183b6dca ("bpfilter: check if $(CC) can link static
libc in Kconfig"), the compiler must be capable of static linking to
enable CONFIG_BPFILTER_UMH, but it requires more than needed.

To loosen the compiler requirement, I changed the dependency as follows:

    depends on CC_CAN_LINK
    depends on m || CC_CAN_LINK_STATIC

If CONFIG_CC_CAN_LINK_STATIC in unset, CONFIG_BPFILTER_UMH is restricted
to 'm' or 'n'.

In theory, CONFIG_CC_CAN_LINK is not required for CONFIG_BPFILTER_UMH=y,
but I did not come up with a good way to describe it.

Fixes: 8a2cc0505c ("bpfilter: use 'userprogs' syntax to build bpfilter_umh")
Reported-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: Michal Kubecek <mkubecek@suse.cz>
Link: https://lore.kernel.org/bpf/20200701092644.762234-1-masahiroy@kernel.org
2020-07-14 12:37:06 -07:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Kconfig bpfilter: Allow to build bpfilter_umh as a module without static library 2020-07-14 12:37:06 -07:00
Makefile bpfilter: Allow to build bpfilter_umh as a module without static library 2020-07-14 12:37:06 -07:00
bpfilter_kern.c bpfilter: Initialize pos variable 2020-07-14 12:31:45 -07:00
bpfilter_umh_blob.S bpfilter: Move bpfilter_umh back into init data 2020-07-04 09:35:50 -05:00
main.c net/bpfilter: remove superfluous testing message 2020-03-31 10:07:51 -07:00
msgfmt.h net: add skeleton of bpfilter kernel module 2018-05-23 13:23:40 -04:00