Skip to content
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

[Bug] $(CC) should be explicitly defined when compiling fixdeps.c #114

Open
PeterWang-dev opened this issue Dec 6, 2024 · 0 comments
Open

Comments

@PeterWang-dev
Copy link

PeterWang-dev commented Dec 6, 2024

Before the first compile of NEMU, $(CONFIG_CC) is not set by KConfig. So calling CC = $(call remove_quote,$(CONFIG_CC)) clears $(CC) by mistake, which leads to the probable failure of make menuconfig when compiling fixdeps.c . And that failure seems distribution dependent (specifically, default GNU Make configuration in each distribution). e.g. Arch Linux seems giving a default value cc to $(CC) for each make instance but Nix does not, which causes error in the latter.

#84 and #89 resolve this problem by adding a check of $(CONFIG_CC), setting $(CC) only if config variable is not empty. However, it doesn't really solve the missing compiler problem but leaving it behind to uncertain fallback value. IMO, as a build prerequisite, the compiling process and tools should be well-defined to ensure menuconfig would work.

So my suggestion is, $(CC) should be explicitly set in tools/fixdep/Makefile :

--- a/nemu/tools/fixdep/Makefile
+++ b/nemu/tools/fixdep/Makefile
@@ -1,3 +1,4 @@
 NAME = fixdep
 SRCS = fixdep.c
+CC = gcc
 include $(NEMU_HOME)/scripts/build.mk
@PeterWang-dev PeterWang-dev changed the title [Feature Request] $(CC) should be explicitly defined when compiling fixdeps.c [Bug] $(CC) should be explicitly defined when compiling fixdeps.c Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant