aregm / nff-go

NFF-Go -Network Function Framework for GO (former YANFF)
BSD 3-Clause "New" or "Revised" License
1.38k stars 156 forks source link

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

Open hicaoc opened 3 years ago

hicaoc commented 3 years ago

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

cang233 commented 3 years ago

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

hsk9169 commented 3 years ago

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

junjiezou1 commented 2 years ago

Have you solved the problem yet???

junjiezou1 commented 2 years ago

Enter the following command:

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

caida-ricky commented 2 years ago

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

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