Skip to content

fix(Makefile): fix menuconfig compile error due to CC and LIBS variable error#931

Draft
Frankslu wants to merge 2 commits intoOpenXiangShan:masterfrom
Frankslu:menuconfig-bugfix
Draft

fix(Makefile): fix menuconfig compile error due to CC and LIBS variable error#931
Frankslu wants to merge 2 commits intoOpenXiangShan:masterfrom
Frankslu:menuconfig-bugfix

Conversation

@Frankslu
Copy link
Contributor

@Frankslu Frankslu commented Oct 15, 2025

  • The first compilation make menuconfig or make riscv***defconfig will fail

  • When first clone this repository, CC is initialized with $(call remove_quote $(CONFIG_CC)). But CONFIG_CC isn't initialized now, so CC will be empty string. So check CONFIG_CC and CONFIG_CXX before CC is initialized.

  • Menuconfig use LIBS= -lncurses -ltinfo, but the target BINARY in build.mk depends on LIBS, which will result in error "No rule to make tartget '-lncurses'". So change LIBS to LDFLAGS

                 correctly compile menuconfig for the first time

* When first clone this repository, CC is initialized with
  $(call remove_quote $(CONFIG_CC)). But CONFIG_CC isn't initialized
  now, so CC will be empty string. So set CONFIG_CC?=gcc and
  CONFIG_CXX?=g++ before CC is initialized.

* Menuconfig use LIBS=  -lncurses -ltinfo, but the target BINARY in
  build.mk depends on LIBS, which will result in error "No rule to make
  tartget '-lncurses'". So change LIBS= to LDFLAGS=
@Frankslu
Copy link
Contributor Author

CI为什么没报错呢()

@cebarobot
Copy link
Member

I can't reproduce the bug. Could you please give reproduction way?

@cebarobot
Copy link
Member

I found that NEMU seems to work in an strage way. If CC isn't set as env var, it works.

So, We may check the whole Makefile more detailly later....

@cebarobot cebarobot marked this pull request as draft October 17, 2025 02:00
@cebarobot
Copy link
Member

I just mark this PR as draft now, until Makefiles are clarified.

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

Successfully merging this pull request may close these issues.

2 participants