-
Notifications
You must be signed in to change notification settings - Fork 21
fix(Makefile): update CFLAGS and LDFLAGS for static linking #61
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request modifies the Makefile to enable static linking of binaries, ensuring they don't depend on shared libraries at runtime. However, the implementation introduces several issues that need to be addressed.
Key changes:
- Adds
-staticflag to both CFLAGS and LDFLAGS - Moves
-lpthreadfrom LDFLAGS to CFLAGS (in addition to keeping it in LDFLAGS) - Removes
--sysroot=$(ROOT)from CFLAGS
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I think directly adding In ifeq ($(ARCH), arm64)
ifeq ($(VIRTIO_GPU), y)
include_dirs += -I/usr/$(toolchain)/include -I/usr/$(toolchain)/include/libdrm -L/usr/$(toolchain)/lib -ldrm
endif
else ifeq ($(ARCH), riscv)
CFLAGS += -static
else ifeq ($(ARCH), loongarch)
CFLAGS += -DLOONGARCH64 -static
ifeq ($(VIRTIO_GPU), y)
include_dirs += -I/opt/libdrm-install/include -L/opt/libdrm-install/lib -I/opt/libdrm-install/include/libdrm -ldrm
endif
endif |
li041
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See Copilot advice and #61 (comment)
You are right that |
ed3411a to
1986ca6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request updates the
CFLAGSandLDFLAGSin the Makefile to enable static linking. This ensures that the generated binary does not depend on shared libraries at runtime.Closes: #60