You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an error while working with the Makefile.
It seems that building with go build ./cmd/naabu in the Dockerfile works perfectly fine. The Makefile might not be necessary after all.
Also, It works perfectly when I remove the following code from the Makefile:
ifneq ($(shell go env GOOS),darwin)
LDFLAGS := -extldflags "-static"
endif
It seems this part isn't necessary for the build to succeed.
test
Naabu version:
v2.3.3
Current Behavior:
When attempting to build naabu (v2.3.3) on Linux using the provided Makefile, the build fails due to static linking issues. Specifically, glibc-related warnings and errors occur, along with unresolved references to dependencies like libpcap and libdbus.
The following error is encountered during the build process:
usr/bin/ld: /tmp/go-link-850181319/000023.o: in function mygetgrgid_r: /_/GOROOT/src/os/user/cgo_lookup_cgo.go:45:(.text+0x44): warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking ... /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/libpcap.a(pcap-dbus.o): in function dbus_write: (.text+0x107): undefined reference to dbus_message_demarshal ... collect2: error: ld returned 1 exit status
~/Opensource_contribution/test/naabu$ go mod tidy
~/Opensource_contribution/test/naabu$ sudo apt install -y gcc g++ make libpcap-dev libdbus-1-dev librdmacm-dev libibverbs-dev musl-dev musl-tools pkg-config
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gcc is already the newest version (4:13.2.0-7ubuntu1).
g++ is already the newest version (4:13.2.0-7ubuntu1).
make is already the newest version (4.3-4.1build2).
libpcap-dev is already the newest version (1.10.4-4.1ubuntu3).
libdbus-1-dev is already the newest version (1.14.10-4ubuntu4.1).
librdmacm-dev is already the newest version (50.0-2build2).
libibverbs-dev is already the newest version (50.0-2build2).
musl-dev is already the newest version (1.2.4-2).
musl-tools is already the newest version (1.2.4-2).
pkg-config is already the newest version (1.8.1-2build1).
0 upgraded, 0 newly installed, 0 to remove and 34 not upgraded.
~/Opensource_contribution/test/naabu$ make
go build -v -ldflags '-extldflags "-static"' -o "naabu" cmd/naabu/main.go
/usr/lib/go-1.22/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-850181319/000023.o: in function `mygetgrgid_r':
/_/GOROOT/src/os/user/cgo_lookup_cgo.go:45:(.text+0x44): warning: Using 'getgrgid_r' in statically linked applications requires at runtime ......
/usr/bin/ld: (.text+0xc3f): undefined reference to `ibv_free_device_list'
collect2: error: ld returned 1 exit status
make: *** [Makefile:15: build] Error 1
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I encountered an error while working with the Makefile.
It seems that building with go build ./cmd/naabu in the Dockerfile works perfectly fine. The Makefile might not be necessary after all.
Also, It works perfectly when I remove the following code from the Makefile:
It seems this part isn't necessary for the build to succeed.
test
Naabu version:
v2.3.3
Current Behavior:
When attempting to build
naabu
(v2.3.3) on Linux using the provided Makefile, the build fails due to static linking issues. Specifically,glibc
-related warnings and errors occur, along with unresolved references to dependencies likelibpcap
andlibdbus
.The following error is encountered during the build process:
Environment:
OS: Ubuntu 22.04
Go version: go1.22.2 linux/amd64
Naabu version: v2.3.3
GCC version: gcc 13.2.0
Installed libraries:
libpcap-dev 1.10.4
libdbus-1-dev 1.14.10
librdmacm-dev 50.0
libibverbs-dev 50.0
musl-dev 1.2.4
pkg-config 1.8.1
Beta Was this translation helpful? Give feedback.
All reactions