nff-go icon indicating copy to clipboard operation
nff-go copied to clipboard

invalid flag in #cgo LDFLAGS: -Wl,--whole-archive

Open hicaoc opened this issue 3 years ago • 5 comments

root@PC:/go/src/github.com/intel-go/nff-go# make make -C nff-go-base make[1]: Entering directory '/mnt/d/go/src/github.com/intel-go/nff-go/nff-go-base' Checking for AVX support... AVX and AVX2 make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/mnt/d/go/src/github.com/intel-go/nff-go/nff-go-base' make -C dpdk make[1]: Entering directory '/mnt/d/go/src/github.com/intel-go/nff-go/dpdk' Checking for AVX support... AVX and AVX2 make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/mnt/d/go/src/github.com/intel-go/nff-go/dpdk' make -C test make[1]: Entering directory '/mnt/d/go/src/github.com/intel-go/nff-go/test' make -C stability make[2]: Entering directory '/mnt/d/go/src/github.com/intel-go/nff-go/test/stability' make -C testMerge make[3]: Entering directory '/mnt/d/go/src/github.com/intel-go/nff-go/test/stability/testMerge' Checking for AVX support... AVX and AVX2 go build -tags "mlx bpf" testMerge.go go build runtime/cgo: invalid flag in go:cgo_ldflag: -Wl,-export-dynamic make[3]: *** [../../../mk/leaf.mk:19: testMerge] Error 1 make[3]: Leaving directory '/mnt/d/go/src/github.com/intel-go/nff-go/test/stability/testMerge' make[2]: *** [../../mk/intermediate.mk:16: testMerge] Error 2 make[2]: Leaving directory '/mnt/d/go/src/github.com/intel-go/nff-go/test/stability' make[1]: *** [../mk/intermediate.mk:16: stability] Error 2 make[1]: Leaving directory '/mnt/d/go/src/github.com/intel-go/nff-go/test' make: *** [mk/intermediate.mk:16: test] Error 2

go version go1.15.5 linux/amd64

hicaoc avatar Jan 14 '21 07:01 hicaoc

https://github.com/intel-go/nff-go/issues/632 may help you

cang233 avatar Jan 20 '21 03:01 cang233

@cang233 the link is broken.. plz provide me another link

hsk9169 avatar Apr 06 '21 12:04 hsk9169

Have you solved the problem yet???

junjiezou1 avatar Mar 10 '22 12:03 junjiezou1

Enter the following command:

export CGO_CFLAGS_ALLOW="." export CGO_LDFLAGS_ALLOW="."

junjiezou1 avatar Mar 13 '22 08:03 junjiezou1

The above command no longer works in go1.19, instead you need to specify the regex.

export CGO_LDFLAGS_ALLOW="-Wl,--(no-)?whole-archive"

caida-ricky avatar Aug 11 '22 03:08 caida-ricky